How can i run two bash scripts at same time?
Hello,
I would like to know how i can run two or three bash scripts at the same time all of them being called from another script. Currently i use /file1 | /file2 | /file3 but there must be a better way as what i really want is to do something like this # "lots of commands in the script file" # then use a command to run file /file1 # whilst this is executing, carry on with the # rest of the scripts in this current file instead of having # to wait for completion of the newly executed file echo "blah blah" if [ la la la ]; then ta ta ta fi Thanks very Much for any ideas |
Append "&" to the command, as in
Code:
(sleep 2; echo "slept two seconds") & echo "second command" Maybe you should have a look at some Bash introduction like this one. |
I use exec and save the PID to a variable. That way I can manipulate the process if necessary, or check to see if it's still running.
|
Hello, Thanks for repling.
I have managed to get a good kind of result by doing this:- (thanks spirit, i used that site sugested) /filepath/file1 & that runs the command in the background as a seperate thing, however Jerp, i'd be interested to hear more about your idea. Could you show me a script or example of your method please Thanks Again all |
All times are GMT -5. The time now is 04:11 PM. |