From owner-freebsd-questions@FreeBSD.ORG Wed Dec 19 23:55:57 2007 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FF0416A417 for ; Wed, 19 Dec 2007 23:55:57 +0000 (UTC) (envelope-from jamesh@lanl.gov) Received: from mailwasher.lanl.gov (mailwasher.lanl.gov [204.121.3.2]) by mx1.freebsd.org (Postfix) with ESMTP id 03FC413C4CE for ; Wed, 19 Dec 2007 23:55:56 +0000 (UTC) (envelope-from jamesh@lanl.gov) Received: from localhost (localhost.localdomain [127.0.0.1]) by mailwasher.lanl.gov (Postfix) with ESMTP id 255C0EC85E7; Wed, 19 Dec 2007 16:55:56 -0700 (MST) X-CTN5-Virus-Scanned: amavisd-new at mailwasher.lanl.gov Received: from mailwasher.lanl.gov (localhost.localdomain [127.0.0.1]) by mailwasher.lanl.gov (Postfix) with ESMTP id 10B6BEC862E; Wed, 19 Dec 2007 16:55:56 -0700 (MST) Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by mailwasher.lanl.gov (Postfix) with ESMTP id 0B8F0EC85E7; Wed, 19 Dec 2007 16:55:56 -0700 (MST) Received: from oppie-mail.lanl.gov (oppie-mail.lanl.gov [128.165.4.123]) by mailrelay1.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id lBJNttcp014437; Wed, 19 Dec 2007 16:55:55 -0700 Received: from [128.165.86.60] (p25dual1.lanl.gov [128.165.86.60]) by oppie-mail.lanl.gov (Postfix) with ESMTP id 74EBB1F8003; Wed, 19 Dec 2007 16:55:49 -0700 (MST) From: James Harrison To: "Mikhail T." In-Reply-To: <200712192322.lBJNMfps053071@aldan.algebra.com> References: <200712192322.lBJNMfps053071@aldan.algebra.com> Content-Type: text/plain Organization: Los Alamos National Labs Date: Wed, 19 Dec 2007 16:55:45 -0700 Message-Id: <1198108545.6721.5.camel@p25dual1.lanl.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.8.0 (2.8.0-33.0.1.el5) Content-Transfer-Encoding: 7bit X-CTN-5-MailScanner-Information: Please see http://network.lanl.gov/email/virus-scan.php X-CTN-5-MailScanner: Found to be clean X-CTN-5-MailScanner-From: jamesh@lanl.gov X-Spam-Status: No Cc: questions@freebsd.org Subject: Re: tail does not exit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: jamesh@lanl.gov List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2007 23:55:57 -0000 On Wed, 2007-12-19 at 18:22 -0500, Mikhail T. wrote: > #!/bin/sh > > if tail -f /var/log/messages | awk '{print "Exiting"; exit 0}' > then > echo Exited > else > echo Failed > fi > > exit 0 I assume it has something to do with tail -f being used, rather than tail. Is there a reason you want the -f flag? tail -f holds on for dear life until a ctrl-c happens. IT HAS A DEATH GRIP! James