Redirecting to Error File

Hi-

I want to redirect the output of the echo to the standard error file. We require this because, when we try to scp a file from a source server to a target server we get an error code 1. Later we found that it was due to the .cshrc file which outputs on stdout which is making the scp to fail.

I know that if we could comment out the echo statements it wouldn't fail. But i thought if we could do something like, redirecting the stdout to stderr then it shouldn't be a problem.

So is there a way of doing this 'redirecting the stdout to stderr' by default and if we could please let me know.

-Lorcan

quick google

  • The following command saves stdout and stderr to the files "out.txt" and "err.txt", respectively.

    [root@server /root]# ./cmd 1>out.txt 2>err.txt

http://www.cpqlinux.com/redirect.html