Date: Thu, 20 Dec 2007 01:49:48 +0200 From: m.boyarov@bsd.by (Max N. Boyarov) To: "Mikhail T." <mi@aldan.algebra.com> Cc: questions@FreeBSD.org Subject: Re: tail does not exit Message-ID: <86abo64543.fsf@bsd.by> In-Reply-To: <200712192322.lBJNMfps053071@aldan.algebra.com> (Mikhail T.'s message of "Wed, 19 Dec 2007 18:22:41 -0500 (EST)") References: <200712192322.lBJNMfps053071@aldan.algebra.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
>>>>> "MT" == Mikhail T. writes:
MT> Why does not the script below actually ever exit?
MT> #!/bin/sh
MT> if tail -f /var/log/messages | awk '{print "Exiting"; exit 0}'
MT> then
MT> echo Exited
MT> else
MT> echo Failed
MT> fi
MT> exit 0
MT> Awk exits as advertised, but tail stays around -- even though its
MT> stdout is closed... Why?
---start quote from man 1 tail---
-f The -f option causes tail to not stop when end of file is
reached, but rather to wait for additional data to be appended to
the input. The -f option is ignored if the standard input is a
pipe, but not if it is a FIFO.
---end quote---
try without "-f" option
--
Max N. Boyarov
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)
iD8DBQFHaa4gXJXgXMoFno8RAmfQAJ91OCy3nH4WkzzLvYL5l96kZHdN7wCfTQTK
tahyb+GNd6Vj0GwxcsgkZko=
=iUog
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86abo64543.fsf>
