QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 629|回复: 6

Run多个文件

[复制链接]
发表于 2004-11-2 15:58:08 | 显示全部楼层 |阅读模式
怎样让一个程序执行多个文件one after one?

发表于 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...");
回复

使用道具 举报

 楼主| 发表于 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.
回复

使用道具 举报

发表于 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
回复

使用道具 举报

 楼主| 发表于 2004-11-3 10:10:12 | 显示全部楼层

You are something!

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

使用道具 举报

发表于 2004-11-3 15:09:09 | 显示全部楼层
用脚本
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-27 17:31 , Processed in 0.071711 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表