Search your unanswered perl queries
Google

Wednesday, December 3, 2008

Redirect to /dev/null

I came across a code snippet like `$ypmatch $host hosts 2>/dev/null` used in one of the perl files I was browsing. Can anyone let me know the significance of redirecting it to /dev/null.

I will post the same when I find it out.

3 comments:

Anonymous said...

It redirects stderr to /dev/null, meaning you won't see anything output on the standard error. You'll still see normal output.

Anonymous said...

By redirecting output (and stderr) to /dev/null you suppress output to standard-out.

Useful in pipes, or if you don't want to clutter screen with logging info.

~h

Nexis said...

Thanks Guyz