終於出來了.我汗啊~~, 各位高手看這裏吧.先謝謝了!!!

先看一下CODE. 我問的話在下麵.

//test.cpp
/*
int main()
{
string file1, file2, outfile;
cout cin>>file1>>file2;
cout cin>>outfile;

return 0;
}
*/

//filename1.txt
test1a.txt test1b.txt
out1.txt

//filename2.txt
test2a.txt test2b.txt
out2.txt

//filename3.txt
test3a.txt test3b.txt
out3.txt


//script
g++ test.cpp
./a.out g++ test.cpp
./a.out g++ test.cpp
./a.out

SO in linux, I just need run the script.
But I have lots of files to test, is that possible if I put all test filenames in one .txt file? such as

//filename.txt
test1a.txt test1b.txt
out1.txt
test2a.txt test2b.txt
out2.txt
test3a.txt test3b.txt
out3.txt


and how to write the script? (need a loop inside the script?)
Anyone has an idea ?
Thank you

所有跟帖: 

你可以在你的test.cpp 裏loop啊 -閑來無事者- 給 閑來無事者 發送悄悄話 (253 bytes) () 12/09/2004 postreply 11:51:30

如果test.cpp 不能改怎麽辦... -兩根發- 給 兩根發 發送悄悄話 (345 bytes) () 12/09/2004 postreply 12:52:19

寫個batch file(Shell Script) -閑來無事者- 給 閑來無事者 發送悄悄話 (8 bytes) () 12/09/2004 postreply 13:30:20

再傻傻的問.... -兩根發- 給 兩根發 發送悄悄話 (49 bytes) () 12/09/2004 postreply 13:40:05

給你個link... -閑來無事者- 給 閑來無事者 發送悄悄話 (48 bytes) () 12/09/2004 postreply 13:44:24

真的非常感謝你!! -兩根發- 給 兩根發 發送悄悄話 (0 bytes) () 12/09/2004 postreply 13:52:24

嗬嗬...搞定了.再說聲謝謝... -兩根發- 給 兩根發 發送悄悄話 (0 bytes) () 12/09/2004 postreply 15:39:39

請您先登陸,再發跟帖!