Unix shell trick: redirecting stderr to stdout

→ In sh/bash: prog > logfile 2>&1; (to separate files) prog > logfile 2> errfile; (pipe) prog 2>&1 |.

→ In csh/tcsh: prog >& logfile; (to separate files) (prog > logfile) >& errfile; (pipe) prog |&.

For some reason I always seem to forget this.

Jul 28, 2005

stdout (/progtricks)
2005-07-28, 08:08 [edit]


  Login:   Password:   [rss] [cc] [w3] [css]

© M. Vallisneri 2012 — last modified on 2010/01/29

Tantum in modicis, quantum in maximis