Log rotation

Derek Martin ddm at pizzashack.org
Sat Aug 4 00:23:56 EDT 2001


On Fri, Aug 03, 2001 at 08:53:14PM -0000, Seth Gordon wrote:
> Hmm, I'll have to look at that Logfile::Rotate module on Monday.  Thanks.
> 
> If anyone has entirely too much free time over the weekend, they can
> explain to me why this script doesn't copy its input into the log file
> (as I expected), but just seems to write a stream of blank lines:

This is your problem:

> while [ read $line ]; do

This test is always true, because the string "read" contains
characters.  However, you haven't asked it to read a line, so the
variable $line is always null for the duration of your script (unless
it inherited a value from the parent shell).  

You may have more success if you remove the brackets and the `$' like so:

  while read line; do

HTH.

-- 
---------------------------------------------------
Derek Martin          |   Unix/Linux geek
ddm at pizzashack.org    |   GnuPG Key ID: 0x81CFE75D
Retrieve my public key at http://pgp.mit.edu

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list