redirect sysout and syserr to same file?

  • Thread starter Thread starter Jeff W
  • Start date Start date
J

Jeff W

I know

type foo >a.s puts foo into a.s
type foo 2>a.s puts errors into a.s

but what if I want both into the same file?

type foo >a.s 2>a.s doesn't work, neither does
type foo 1>a.s 2>a.s

i can send them to separate files and concatenate - but what a hack

thanks
/j
 
Jeff said:
I know

type foo >a.s puts foo into a.s
type foo 2>a.s puts errors into a.s
You might try f >a.s 2>&1. It works under bash. Maybe it'll work on MS.
 
Jeff said:
I know

type foo >a.s puts foo into a.s
type foo 2>a.s puts errors into a.s

but what if I want both into the same file?

type foo >a.s 2>a.s doesn't work, neither does
type foo 1>a.s 2>a.s

i can send them to separate files and concatenate - but what a hack

thanks
/j

type foo>a.s 2>&1

The >& operator writes the output from one handle to the input of
another handle. So in the above the output of stderr is redirected to
stdout, which is then redirected to a.s.
--
Tom Porterfield
MS-MVP Windows
http://support.telop.org

Please post all follow-ups to the newsgroup only.
 
thanks guys


Tom said:
type foo>a.s 2>&1

The >& operator writes the output from one handle to the input of
another handle. So in the above the output of stderr is redirected to
stdout, which is then redirected to a.s.
 
Back
Top