1

I just created this script to run the following commands all together at the same time:

#!/bin/bash
cd /home/me/Desktop/folder/app1
sudo service mongod start
grunt dev
cd ../app2
npm start
cd ../app3
npm start
http-server
sudo service nginx restart

but it only runs the first three lines .. help please

Zanna
  • 70,465
h_h10a
  • 111
  • 1
    Shell scripts run the commands sequentially, not in parallel. I'm not familiar with grunt, but I suspect it is not written to daemonize, so you need to background it either with & or with an application-specific flag. What happens if you execute grunt dev at the command line? Are you returned a prompt or does the prompt not return until you cause the grunt process to exit? – user4556274 Dec 26 '16 at 13:17
  • grunt dev can be replaced with npm start , its perks are that changes that we make are updated instantly, so we use it instead of corrupting npm start and rerunning it – h_h10a Dec 26 '16 at 13:24
  • For the other cd commands I would have the absolute paths. – jtoscarson Dec 26 '16 at 14:11

0 Answers0