Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Yup... | 30 comments | Create New Account
Click here to return to the 'Yup...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Yup...
Authored by: robg on Nov 04, '01 12:38:45AM

That's what Apple changed ... by the way, what does the "2 > /dev/null" part do? I know "> /dev/null" is redirect to null, but what's the "2" for?

-rob.



[ Reply to This | # ]
Yup...
Authored by: Brad Puett on Nov 04, '01 02:04:54AM

That's what Apple changed ... by the way, what does the "2 > /dev/null" part do? I know "> /dev/null" is redirect to null, but what's the "2" for?

-rob.




" 2> " refers to Standard Error, just as " > " refers to Standard Output. So the statement " 2> /dev/null " means that any "leftover" error messages will be "trashed" (i.e. discarded, thrown away).

Hope that was clear!


[ Reply to This | # ]
2 /dev/null
Authored by: reverie on Nov 04, '01 02:07:01AM

2> /dev/null
will consolidate the standard output (stdout) and diagnostic output (stderr) of the preceding command and then send it to /dev/null (i.e., a black hole). Basically, it's making sure the script stays quiet. It's a feature of sh, the Bourne shell, and you can read more about it if you 'man sh'.



[ Reply to This | # ]