Link to home
Start Free TrialLog in
Avatar of cbur2107
cbur2107

asked on

Linux Script

I am writing a linux script to automate a few commands I wish to run on my machine.  My question is this:

I have about 5 -10 commands I need to run in the script.  But there are a few commands that I need it to open up a new shell and run them seperately from the others.

Example:

Commands 1-4 in one shell
5-6 in another shell
7-9 in a third shell for a total of 3 shells when the script completes.

How do I tell the script to open a new shell when running one of the specific commands?  Is that possible?
ASKER CERTIFIED SOLUTION
Avatar of simon3270
simon3270
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cbur2107
cbur2107

ASKER

i will give that a try and let you know.

Thanks.

simon3270's should work fine as long as there is no inter-dependence between results or actions from or between shell1 shell2 and shell3. obviously command1;command2;command3 and command4 will run sequentially but you may run into the case where command5 thru command89 finish ahead of command1.  By putting the three shells in background all three will start executing immediately.  if that is what you want then it should work fine.
So how do you tell the script to start one command AFTER another rather than all executing immediately...?
you could have the last line of script one call script two and the last line of script 2 call script three.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial