From nobody@FreeBSD.org  Mon Aug 28 22:14:18 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6BB2C16A4DF
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 Aug 2006 22:14:18 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 38BBD43D49
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 Aug 2006 22:14:18 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k7SMEIHc016677
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 Aug 2006 22:14:18 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k7SMEHfL016676;
	Mon, 28 Aug 2006 22:14:17 GMT
	(envelope-from nobody)
Message-Id: <200608282214.k7SMEHfL016676@www.freebsd.org>
Date: Mon, 28 Aug 2006 22:14:17 GMT
From: Eric Huss <e-huss@netmeridian.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: lesspipe.sh does not handle file updates
X-Send-Pr-Version: www-2.3

>Number:         102624
>Category:       bin
>Synopsis:       less(1): lesspipe.sh does not handle file updates
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 28 22:20:12 GMT 2006
>Closed-Date:    Sun Sep 03 16:11:21 GMT 2006
>Last-Modified:  Sun Sep 03 16:11:21 GMT 2006
>Originator:     Eric Huss
>Release:        6.1
>Organization:
IronPort
>Environment:
6.1-RELEASE
>Description:
The lesspipe.sh that ships with FreeBSD does not allow you to "tail" or "follow" a file that is changing (such as a logfile).
>How-To-Repeat:
Set the LESSOPEN environment variable:

export LESSOPEN="|lesspipe.sh %s"

Run "less" on a file that has data appending to it (such as a logfile).

Press capital G to try to view more data...notice that it does not detect file changes.  Press capital F to try to "follow" appended data, notice that it does not work.
>Fix:
Remove the call to "cat" from the lesspipe.sh sample that ships with FreeBSD:

        *)
                exec cat $1             2>/dev/null
                ;;

I'm not sure if there was a reason it was added (in CVS revision 1.2), because less works just fine without it (and the man page example does not have a * entry).

diff -u -r1.2 lesspipe.sh
--- lesspipe.sh 17 May 2005 11:08:11 -0000      1.2
+++ lesspipe.sh 28 Aug 2006 22:13:12 -0000
@@ -13,7 +13,4 @@
        *.bz2)
                exec bzip2 -d -c $1     2>/dev/null
                ;;
-       *)
-               exec cat $1             2>/dev/null
-               ;;
 esac

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->delphij 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Wed Aug 30 03:16:32 UTC 2006 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=102624 
State-Changed-From-To: open->patched 
State-Changed-By: delphij 
State-Changed-When: Wed Aug 30 08:20:37 UTC 2006 
State-Changed-Why:  
Patch applied against -HEAD.  Will MFC soon. 

Thanks for your submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=102624 
State-Changed-From-To: patched->closed 
State-Changed-By: delphij 
State-Changed-When: Sun Sep 3 16:10:59 UTC 2006 
State-Changed-Why:  
Patch applied to RELENG_[56], thanks for your submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=102624 
>Unformatted:
