Redirect StdErr to Stdin in Batch and Shell Scripts

On windows command prompt :

mybatch.bat 1> log.txt 2>&1

This redirects stdin to log.txt and stderr to stdin

On Bash Linux Shell:
grep * &> allout.txt


Comments

Popular posts from this blog

Connect via SSH without a password from MacOS to Linux with an SSHKEY

Escape HTML and XML in Java

Sort a HashMap based on Keys or Values