easy question: how to redirect stdin and stderr in sh?

Kartik Subbarao subbarao at phoenix.Princeton.EDU
Sun Sep 23 08:36:41 AEST 1990


In article <750 at inesc.UUCP> jmc at inesc.UUCP (Miguel Casteleiro) writes:
>The subject says it all!  I want to redirect to a file in shell
>(/bin/sh) the stdin and stderr of a process.
>So, how do I do it?

Arrgh! This was covered just a few days ago -- even then, its in the
Frequently Asked Questions list which should be consulted before posting!
Even better, the bourne (/bin/sh) man pages!

use process > stdoutfile to redirect only stdout
    process 2> stderrfile to redirect only stderr
    process > stdoutfile 2> stderrfile to redirect both separately
    process > stdoutanderrfile 2>&1 to redirect both together

                                                               __  ///
 Maybe you should spend some more>"News: so many articles,     \\\/// Only
                           time!>  so little time..."           \XX/ Amiga

								^^^^^^^^^^^^^
							I guess if you restrict
							yourself to such toys,
							you can't learn much
							else. ;-)


			-Kartik




(I need a new .signature -- any suggestions?)
subbarao@{phoenix or gauguin}.Princeton.EDU -|Internet
kartik at silvertone.Princeton.EDU (NeXT mail)       -|	
subbarao at pucc.Princeton.EDU		          - Bitnet



More information about the Comp.unix.questions mailing list