Thursday, August 25, 2005

Unix /dev/null

In quite a few unix programs ( shell scripts) I see the following command =

someprog > /dev/null 2>&1

The > /dev/null 2>&1 part means to send any standard output to /dev/null (the linux trash can) and to redirect standard error (2) to the same place as the standard output (1). Basically it runs the command without any output to a terminal etc.

No comments:

Post a Comment