[ydl-gen] Sending mail from the command line

Bill Fink billfink at mindspring.com
Sat Sep 9 10:32:21 MDT 2006


On Fri, 08 Sep 2006, Joseph E. Sacco, Ph.D. wrote:

> Eric,
> 
> "> /dev/null 2>&1 " takes any output directed to stdout or stderr and
> redirects it to the bit bucket, /dev/null. 
> 
> Specifically:
> * redirect stdout to /dev/null
> 
>    > /dev/null
> 
> * redirect stderr to stdout
> 
>    2>&1
> 
> 
> A construct like this is often used in a crontab entry. 

And the reason for this is that by default any output from a crontab
command is e-mailed to the crontab owner.  So if you only want the
command to be executed, and don't care to see the output of the command,
you have to make sure the command doesn't generate any output to either
stdout or stderr, and you do this with the "> /dev/null 2>&1" construct,
which says to send stdout to the bit buckout, and send stderr to the
same place as stdout (stderr is file descriptor "2" which is
redirected ">" onto file descriptor "&1" which is stdout).

						-Bill


More information about the yellowdog-general mailing list