FreeBSD Server Administration

« Optimizing MySQL | Main | Screen Command »

November 04, 2004

Redirect Output to Email

If you prefer to reading long document or output on Windows, output redirect does this job well, for example,
# mysqladmin variables | mail yourname@domain.com

But I don't know why the following command doesn't work, only got an empty message.
# man crontab | mail yourname@domain.com
(Update: please read comments for explanation)


Category : Tips

Posted by FreeBSD Newbie at November 4, 2004 01:50 PM

Comments

It did not work because nothing was sent by the 'man' program to "standard out". The pipe mail command ("blah | mail user@example.com") will work for any programs that terminate immediately without input from the user. In your case, the program 'man' requires user input to scroll down in the manual and also to quit.

Posted by Mike at November 6, 2004 06:34 AM

Many thanks, Mike, now I got it, cheers!

Posted by Linux Newbie at November 6, 2004 06:39 AM

Post a comment



(Optional, will not be shown to the public)

Remember Me?