最初由 enruan 发表 root # [color=green](make;date;sleep 5;make;date) 2>logfile | cat logfile[/color] -bash: make: command not found root # [color=green]more logfile[/color] -bash: make: command not found -bash: make: command not found 复制代码
使用道具 举报
最初由 enruan 发表 这样不行,logfile 里只要2的,不要1的
最初由 home_king 发表 你是要看输出,为什么要把输出放到/dev/tty呢?这样不是很矛盾嘛?
最初由 javalee 发表 command 2>logfile|tee
最初由 home_king 发表 sorry,在下今天下午要上课。 希望以后兄弟要耐心点,另外,要把问题说明白。 我是根据你的回复,而且你要求的功能的确已经实现了呀。才把帖子置成已解决的。如果有不对的地方,还请你多多包涵。我现在把它置回原状,ok。
最初由 enruan 发表 Yes,sir! 我没别的意思, 就是没人理我,我湿着急,呵呵
最初由 javalee 发表 还没有人理你?! ....晕~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
最初由 enruan 发表 root # (make;date;sleep 5;make;date) 2>logfile | cat logfile -bash: make: command not found root # more logfile -bash: make: command not found -bash: make: command not found
最初由 enruan 发表 exec 9>&1 cmd 2>&1 >&9 9>&- | tee logfile 9>&- exec 9>&- 复制代码 (make;date;sleep 5;make;date) 2>&1 >/dev/tty | tee logfile 对于父进程来讲,通常应该是以/dev/tty做标准输出的 这样就不用fd9了
本版积分规则 发表回复 回帖后跳转到最后一页