serve.sh 310 B

1234567891011121314
  1. #!/bin/bash
  2. # Create a named pipe for output handling
  3. PIPE=$(mktemp -u)
  4. mkfifo $PIPE
  5. # Start handling the output in background
  6. cat $PIPE | grep -v '^\([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\|.*\.\{3\}\)' &
  7. # Run artisan serve and redirect its output to our pipe
  8. php artisan serve > $PIPE 2>&1
  9. # Cleanup
  10. rm $PIPE