开发者

how to run two perl scripts simultaneously fromt the same directory?

开发者 https://www.devze.com 2023-01-18 10:59 出处:网络
i want to run two perl scripts a开发者_运维百科t the same time from the same directory , from the command prompt , so that either of their outputs should not affect each other If the scripts output to

i want to run two perl scripts a开发者_运维百科t the same time from the same directory , from the command prompt , so that either of their outputs should not affect each other


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.


well what's wrong with trying

scriptone > outputone.log && scripttwo > outputtwo.log

?


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消