descript: progam.cpp
g++ progam.cpp -o descript
./descript 2>output.txt | tee -a output.txt
根据我的理解,第一个命令编译program.cpp,第二个命令将输出发送到终端和一个文本文件。
是否有办法调整这个,使我:
- 使用"制造"。通过程序提示。输出保存在Output .txt 中
- 使用"。/description "或其他命令,用新的输出 覆盖output.txt。
我对linux命令比较陌生,所以任何东西都会有所帮助。
在Makefile
中包含make clean
函数可能会有所帮助。
示例make clean
函数可以包括:
make clean:
rm -f output.txt
然后,在Makefile
的descript
部分的开头插入make clean
以自动删除先前的输出。