|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: A quick question about scripting
From: Greg Wooledge (greg
wooledge.org)
Date: Thu Sep 02 2004 - 20:52:05 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Tomas (wisher
myliu.m-1.lt) wrote:
> sendmail -bd && cd /var/log/ && gunzip maillog.6.gz && more maillog.6 |
mail
> -s Test my
mail \
Han already gave you a working example, but here's why yours failed.
This command:
more maillog.6 | mail -s Test my
mail
cannot work properly in a non-interactive script. more(1) displays a
file a page at a time, pausing for user input at the end of each page.
Since your script is not interactive, it'll never get user input, so
it'll never go on to the second page.
If you had used cat(1) instead, then it might have worked, although
it's not the most efficient way of going about it.
--
Greg Wooledge | "Truth belongs to everybody."
greg
wooledge.org | - The Red Hot Chili Peppers
http://wooledge.org/~greg/ |
[demime 0.98d removed an attachment of type application/pgp-signature which had a name of signature.asc]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]