Jump to content

redirect stdout and stderr from Windows shell


Recommended Posts

Guest Ronald Fischer
Posted

How can I redirect stdout and stderr to the same file from a Windows

command line?

 

I know how to redirect them to different files:

 

myprog >stdout.log 2>stderr.log

 

but I need them in the same file.

 

Under bash, I would do a

 

myprog 2>&1 >myprog.log

 

Ronald

 

 

--

Ronald Fischer <ronaldf@eml.cc>

Posted via http://www.newsoffice.de/

  • Replies 1
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

Re: redirect stdout and stderr from Windows shell

 

 

"Ronald Fischer" <ronaldf@eml.cc> wrote in message

news:1185532281.78@user.newsoffice.de...

> How can I redirect stdout and stderr to the same file from a Windows

> command line?

>

> I know how to redirect them to different files:

>

> myprog >stdout.log 2>stderr.log

>

> but I need them in the same file.

>

> Under bash, I would do a

>

> myprog 2>&1 >myprog.log

>

> Ronald

>

>

> --

> Ronald Fischer <ronaldf@eml.cc>

> Posted via http://www.newsoffice.de/

>

 

Much the same under Windows:

 

myprog 1>stdout.log 2>&1


×
×
  • Create New...