Platform-independent "/dev/null" stream redirection?
I'm writing a shell script that will (hopefully) be portable to non-Linux environments. The script runs some commands (such as 'expr' evaluations) for which I don't care about the standard output; all I need is the exit status. Redirecting to /dev/null works on *NIX, but by most accounts it's unsafe to assume that /dev/null even exists.
What's a portable way to redirect/ignore the standard output of a command? I thought about redirecting to a garbage-file, but I'd like something more elegant.
|