Tuesday, October 17, 2006

How to get rid of output of your scripts?

Just add at the end of your command line: >/dev/null 2>&1 so you redirect fd1 to /dev/null, then dump it onto fd2:

Normally: fd1 -> stdout fd2 -> stderr

>/dev/null: fd1 -> /dev/null fd2 -> stdout

2>&1: fd1 -> /dev/null fd2 -> /dev/null


Now no more output, it is very interessant espscially for cronjob.

No comments: