例如:C程序为
#include <stdio.h>
int main()
{
printf("hello world!");
return 1;
}
编译后的结果为 helloExe
如果用shell调用helloExe后,如何将helloExe中打印的"hello world!"字符保存成文件?
在shell调用时,重定向输出的信息:
./helloExe > test.txthello world!就保存到文件test.txt中了。
命令如下
./helloExe > savefile