Home » Questions » Computers [ Ask a new question ]

How do I combine stdout and stderr for different shells?

How do I combine stdout and stderr for different shells?

I know the answer for some shells, e.g. with cmd.exe you can:

Asked by: Guest | Views: 209
Total answers/comments: 1
bert [Entry]

"In Powershell it is exactly the same:

2>&1 Sends errors to the get-process none, powershell 2>&1
success output stream.

(from about_Redirection).

In bash and ksh at least I also know it works this way.

It seems to be a common convention.

A quick way to find out about it is by opening the man page of the shell and do a search for &1 (with / and then typing &1). This rarely occurs in other contexts."