3

this command is to redirect output of time to with multiple args:

$ time wc test >wc.out 2>time.out

unix programming environment book shows that the error output of time redirects to time.out, but it seems that it's treating the 2>time.out portion as part of the wc command and not redirecting the error output to time.out as I expected, so what is the problem?

5

The usual solution to this problem is to put your time command in a group:

$ { time wc test >wc.out; } 2>time.out

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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