<body class='hmmessage'><div dir='ltr'>The '/dev/null' device is essentially a device driver with a 'face' and no 'body'. It can<br>also be looked at as the 'bit-bucket' device. You can write all the data that you want to<br>it, and it will do nothing with it, and you can attempt to read from it as many times as<br>you want, and it will never have data for you.<br><br>A shell (command line) oriented program in a UNIX(1) (or UNIX-like, such as Linux) environemnt<br>has 3 "standard" "streams" of characters associated with it. "stdin" (the stream from which it<br>receives
characters as input, such as the keyboard you are typing on), "stdout"
(the stream to which it outputs characters for "normal" uses, such as
the display that you are looking at), and "stderr"<br>(also for outputting characters, but normally to indicate some erroneous condition). Streams<br>are type of "files" and are accessed through "file handles", of which stdin is file handle "0".<br>stdout is file handle "1". and stderr is file handle "2". Whatever additional files and/or streams<br>your process opens are assigned larger file handle numbers, etc. <br><br>From a shell (command line), you can "redirect" any of these streams to non-default places, such<br>as
a case like this, where you want no "normal" or "error" output, and you
re-direct it to go to "/dev/null"., effectively making your program not
output anything anywhere.<br><br>The ">/dev/null 2>&1" syntax
means "redirect stdout to /dev/null, and redirect stderr (file handle
2) to whatever file handle 1 (stdout) is doing".<br><br>Jim, WB6NIL<br><br>(1) UNIX is a footnote of Bell Laboratories. <br><br>:-)<br><br><div><hr id="stopSpelling">Date: Sat, 22 Aug 2015 14:42:08 -0400<br>From: N1XBM@amsat.org<br>To: firstname.lastname@example.org<br>Subject: [App_rpt-users] dev/null<br><br><p dir="ltr">Can anyone explain proper syntax and use of dev/null I understand it is to have the cron executed and do nothing in terms of logging the output. </p>
<p dir="ltr">Not everything in my cron uses it and the ones that do have different variations such as.</p>
<p dir="ltr">>/dev/null 2>&1<br></p>
<p dir="ltr">&> /dev/null 2>&1<br><br><br></p>
Allstar Node # 27086, 41540, 41812</p>
App_rpt-users mailing list
To unsubscribe from this list please visit http://ohnosec.org/cgi-bin/mailman/listinfo/app_rpt-users and scroll down to the bottom of the page. Enter your email address and press the "Unsubscribe or edit options button"
You do not need a password to unsubscribe, you can do it via email confirmation. If you have trouble unsubscribing, please send a message to the list detailing the problem.</div> </div></body>