bash shell如何加载c程序
-
- 帖子: 59
- 注册时间: 2008-01-04 22:21
bash shell如何加载c程序
想在bash shell加载一个c程序(比如当前目录下的test.cpp),并且运行这个c++程序50次,请问在bash shell要怎么写。
- lilydjwg
- 论坛版主
- 帖子: 4249
- 注册时间: 2009-04-11 23:46
- 系统: Arch Linux
- 联系:
Re: bash shell如何加载c程序
[bash]
#!/bin/bash
g++ -o test test.cpp || exit $?
for i in {1..50}; do
./test
done
[/bash]
#!/bin/bash
g++ -o test test.cpp || exit $?
for i in {1..50}; do
./test
done
[/bash]
-
- 帖子: 59
- 注册时间: 2008-01-04 22:21
Re: bash shell如何加载c程序
解决了,谢谢2楼的兄弟了