misc/102624: lesspipe.sh does not handle file updates

Eric Huss e-huss at netmeridian.com
Mon Aug 28 22:20:19 UTC 2006

>Number:         102624
>Category:       misc
>Synopsis:       lesspipe.sh does not handle file updates
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 28 22:20:12 GMT 2006
>Originator:     Eric Huss
>Release:        6.1
The lesspipe.sh that ships with FreeBSD does not allow you to "tail" or "follow" a file that is changing (such as a logfile).
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.
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 @@
                exec bzip2 -d -c $1     2>/dev/null
-       *)
-               exec cat $1             2>/dev/null
-               ;;


More information about the freebsd-bugs mailing list