Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to log the standard output and error info from running my program, using the following command:

  stdbuf -o 0 ./myprogram|& tee mylog

it works fine in one computer, I can see both standard output and stderr output on screen and in mylog. but in another computer, I can only see the standard output in screen and mylog. They are both Fedora OS and x86_64.

share|improve this question
    
Are you using the same shell on both machines? –  paraxor Jun 20 '13 at 15:49
    
Also, please rephrase your question to be a real question. Are you looking for working alternatives to your current command or are you looking to find out why that doesn't work? –  paraxor Jun 20 '13 at 15:53
add comment

1 Answer 1

up vote 2 down vote accepted

Try making both stdout and stderr unbuffered.

stdbuf -e 0 -o 0 ./myprogram |& tee mylog

Edit: I replaced my original answer. The above is most likely a solution to the problem.

share|improve this answer
    
strange, with stdbuf -o 0 ./myprogram 2>&1 | tee mylog, the problem persists –  user1944267 Jun 20 '13 at 17:39
    
I have added another possibility to my answer. –  paraxor Jun 20 '13 at 17:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.