作者hardware (硬体)
看板Linux
标题[问题] terminal内容输出到 txt
时间Tue Aug 4 15:33:19 2015
以往我都是用
$ ./test > test.txt
test这个program里面printf的内容 就会输出到 test.txt
但是今天我下这指令却不会输出进去 只会产生test.txt的空白档案
是哪边出了问题?
我的test执行档都没有改过
有时候可以输出有时候不行 有人有遇过吗
想不知是什麽原因?? (苦恼中
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.117.164.19
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Linux/M.1438673602.A.76F.html
1F:推 rickieyang: stdout stderr ? 08/04 16:08
2F:→ rickieyang: ./test > filename 2>&1 08/04 16:09
3F:→ yan12125: 哪一种shell? bash/zsh的话可用./test >& test.txt 08/04 16:17
4F:→ hardware: stdout 08/04 19:21
5F:→ hardware: bash 08/04 19:21
6F:→ yan12125: strace看一下有没有write成功 08/07 15:47