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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top