i want to run two perl scripts at the same time from the same directory , from the command prompt , so that either of their outputs should not affect each other
A:
Just do it. They will not interact unless they write files. If they write files, and the file names are not configurable, you are out of luck - you will have to run them from separate directories (or make the file names configurable, and for that you did not give enough information to go on).
Amadan
2010-10-04 11:50:59
i want to do it with one command . i mean i dont want to run them separately
mekasperasky
2010-10-04 11:52:24
+3
A:
If the scripts output to stdout, you could just pipe them to two different files:
perl script1.pl >output1.txt & perl script2.pl >output2.txt &
The last ampersand is of course optional, if you want your terminal to block. This forks the first command to the background, executing the second immediately after the first one has started.
Since the output is piped to two different files, output won't be intermixed.
myme
2010-10-04 11:54:50
+2
A:
well what's wrong with trying
scriptone > outputone.log && scripttwo > outputtwo.log
?
thomasmalt
2010-10-04 11:55:33