1. /bin/sh
prog > /dev/null 2>&1 <-- ok
prog > /dev/null 2>/dev/null <-- ok
prog >& /dev/null <-- ok
2. /bin/csh
prog > /dev/null 2>&1 <-- fail
Ambiguous output redirect.
prog > /dev/null 2>/dev/null <-- fail
Ambiguous output redirect.
prog >& /dev/null <-- ok, recommend
3. FreeBSD /etc/crontab
SHELL=/bin/sh
prog >& /dev/null <-- fail, bad FD
prog &> /dev/null <-- not good, is bg
prog > /dev/null 2>&1 <-- ok
*Âü°í) /bin/bash
prog &> /dev/null <-- not good
prog >& /dev/null <-- ok
|