1832058 Members
3128 Online
110034 Solutions
New Discussion

How do I

 

How do I

Hi,

Can someone tell me how I redirect STDOUT and STDERR for a process (such as cpio). I have used
|cpio -oB > /dev/rmt/0m 2>
to redirect STDOUT, is it possible to redirect STDERR too, but possibly to a different place ?


Also can you reccomend any good books for a UNIX newbie in which i would find out such things.

Thanks
2 REPLIES 2
Barry O Flanagan
Respected Contributor

Re: How do I

On the books side of things:

Any of the O'Reilly series of books are excellent, the "Learning The Korn Shell" one is top notch (ISBN 1-56592-054-6). Lots of shell prog stuff in there.

Your I/O file descriptors are :
stdin 0
stdout 1
stderr 2

Outputing stdout and stderr to different places might be done with :

2> stderrfile 1> stdoutfile

(I'm open to correction on this!!!)
federico_3
Honored Contributor

Re: How do I

You should do like this:

|cpio -oB > /dev/rmt/0m 1> file.out 2> file.err

federico