Date: Mon, 28 Aug 2006 22:14:17 GMT From: Eric Huss <e-huss@netmeridian.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/102624: lesspipe.sh does not handle file updates Message-ID: <200608282214.k7SMEHfL016676@www.freebsd.org> Resent-Message-ID: <200608282220.k7SMKCqO066616@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 102624
>Category: misc
>Synopsis: lesspipe.sh does not handle file updates
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Aug 28 22:20:12 GMT 2006
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608282214.k7SMEHfL016676>
