softwindblow 发表于 2004-11-2 15:58:08

Run多个文件

怎样让一个程序执行多个文件one after one?

:roll:

gucuiwen 发表于 2004-11-2 16:03:41

#program1;prgram2;program3; ....

use ";" to execute command on after another.

自由狼-台风 发表于 2004-11-2 21:10:06

C语言吗?
system("aaa;bbb;ccc...");

softwindblow 发表于 2004-11-2 23:03:57

It is Linux----Thanks a lot

I'd like to run the same command to different files one after one,

$ command1 file1 >& junk &

after the calculation finish(usually 5 hours or more), I hope my computer can run the second file automatically, that is:

$ command1 file2 >& junk &

and then

$ command1 file3 >& junk &

and so on.

gucuiwen 发表于 2004-11-3 09:20:58

edit a text file ,the contents of the file are the commands you want to run:

command1 file1 >& junk &
command1 file2 >& junk &
command1 file3 >& junk &

save the file ,named it as "commander"

then change this file as a executable file:

$chmod u+x commander

the last step you should do is just run it:

$ ./commander

softwindblow 发表于 2004-11-3 10:10:12

You are something!

That is wonderful!! Thank you so much. I will try it soon.

suowei1979 发表于 2004-11-3 15:09:09

用脚本
页: [1]
查看完整版本: Run多个文件