On Tue, Jan 04, 2000 at 12:52:11AM +0600, [EMAIL PROTECTED] wrote:
> On Mon, Jan 03, 2000 at 09:20:17AM -0800, Ray Olszewski wrote:

> Hi Ray,

> > you want:
> >         startx >oops 2>&1

> I have seen this "2>&1" many times
> What does it really mean ?

        It means, literally, map file descriptor 2 (stderr) over top of
file descriptor 1 (stdout).  If you redirect stdout to a file ( > stdoutfile )
this then maps stderr to the same place that stdout is going, so you
get all the output in one file.

        Ex:

        foo > foo.out 2> foo.err

        Sends stdout from foo to foo.out and stderr to foo.err (not the 2>
notation is the same as 2>&1 - it means do this to fd #2).

        foo > foo.out 2>&1

        Sends both stdout and stderr to foo.out.  The 2> remains the same
but the &1 in place of a file name redirects it to another file descriptor.

> best regards
> Jacob

        Mike
-- 
 Michael H. Warfield    |  (770) 985-6132   |  [EMAIL PROTECTED]
  (The Mad Wizard)      |  (770) 331-2437   |  http://www.wittsend.com/mhw/
  NIC whois:  MHW9      |  An optimist believes we live in the best of all
 PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!

Reply via email to