start applications with shell script
I am trying to start multiple application with a shell script,but have no idea how to do it.
Basically, i want to start the same application in different directories, say consumer1/app, consumer2/app, consumer3/app I was thinking about writing a script like: ------------------- cp app consumer1/ execute consumer1/app cp app consumer2/ execute consumer2/app . . . ------------------- My problem is that I don't know how to execute to app (execute consumer2/app) in such a way that the script can continue. Does anyknow have a solution for me? |
Quote:
Code:
consumer2/app >> /dev/null 2>&1 & |
Quote:
Code:
cp app ./dir1 |
The prog will be called by searching your $PATH, unless you specify a relative or absolute path.
Running a prog in different dirs can mean 1 of several things 1. run the (one version) of the prog and pass the dir to use as a cmd line param, if it accepts that method. 2. have a separate copy of the prog in each desired dir and cd into that dir and call it with ./prog 3. cd into the desired dir and call the prog via $PATH 4. cd into the desired dir and call the prog using an absolute path 5. cd into the desired dir and call the prog using a relative path Incidentally, it's prog & not prog& to background a prog; note the space there. To avoid the prog terminating when you logout, add nohup thus nohup prog & HTH |
All times are GMT -5. The time now is 02:08 PM. |