[ydl-gen] Sending mail from the command line

Eric Dunbar eric.dunbar at gmail.com
Fri Sep 8 21:17:17 MDT 2006


On 07/09/06, Joseph E. Sacco, Ph.D. <joseph_sacco at comcast.net> wrote:
> Of course, a pipe should work, assuming sendmail is running. Here is an
> example:
>
>     % ls | mail -s "output of ls"  jsacco > /dev/null 2>&1

Question time:

What does the "> /dev/null 2>&1" do?

I understand that the | is the 'pipe' and it redirects the output from
the first command to the input for the second but what do the
following arguments do?:
'>'
'/dev/null 2'
'>&1'

When I try:
ls | mail -s "output of ls"  username > /dev/null 2>&1

and

ls | mail -s "output of ls"  username

I get the same e-mail with either command.

Thanks, Eric.


More information about the yellowdog-general mailing list