0

On my dev machine, I'm very often starting a lot of services at once (10+), and then at once I kill them using CTRL+C (very important).

The problem is that the output will be presented is only for the latest command. for example:

$ npm run service-a | npm run service-b | npm run service-c

In this case, I will see output only from service-c.

Running with & will cause many processes to be opened. Running with && will run only the first task because its a live service.

What are my options?

Thanks

3
  • If you are making a service, you should log its output to file. Services shouldn't output to console. – Tero Kilkanen Oct 11 '20 at 15:38
  • @TeroKilkanen - this is only in development... – SexyMF Oct 11 '20 at 16:22
  • The pipe sends the output of one command to the input of the next. That is why you do not see it. – Michael Hampton Oct 11 '20 at 17:49
0

Found it

sh -c "npm run service-a & npm run service-b & npm run service-c & wait"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.