Redirect Output to Email
November 4, 2004 Posted by KP
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)
Related Posts:
Filed Under: Tips
November 6th, 2004 at 6:34 am
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.
November 6th, 2004 at 6:39 am
Many thanks, Mike, now I got it, cheers!