Run SH Commands in Background

1

I have a bunch of scripts that I need to run to start up a couple Node.js scripts and Mongo, among a couple other things. I'd like to create an SH script that I could run to start ALL of these at once. The problem is, each of these will not return until they crash or I quit them... I think this would prevent the script from advancing to launch the rest of the programs I want to run.

For example:

node script.js
mongod
./anotherscript.sh

How would I get an SH script to start ALL of these, even if mongod won't return until it crashes?

Andrew M

Posted 2011-12-17T22:30:52.970

Reputation: 705

Answers

4

Use the amperstand. This will launch the command returning the control.

mongod &

jap1968

Posted 2011-12-17T22:30:52.970

Reputation: 827

Worked perfectly :) – Andrew M – 2011-12-17T22:47:51.467