Hacker News new | ask | show | jobs
by abbeyj 1524 days ago
In one terminal, run:

  $ mkfifo myfifo
  $ while true; do sed -rune 's/^Dev server started on port (.*)/\1/p' myfifo | xargs -n1 -I{} echo "Execute other command here with argument {}"; done

In the other terminal, run your server and tee the output to the fifo you just created:

  $ start_server | tee myfifo
1 comments

Thanks for this!