[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tail and grep

> > tail -f /var/log/messages | grep "local  IP" > /home/pppusers/dynamic.IP
> > 
> > it does nothing but create a 0 byte file.
> "tail -f" will run forever; output to the file won't be flushed until you've
> written a certain amount to the file -- one line obviously isn't enough.
> The screen on the other hand is flushed immediately. I suspect you don't
> really need the -f for tail, especially if you are just running this
> from the ip-up script or something.

If I ran tail from the script without the -f, it would terminate
immediately.  Since tail would terminate before the chat part of the
script has even finished, it would never see the string I'm looking for.

Am I making any sense here?

Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null

Reply to: