From owner-freebsd-stable@FreeBSD.ORG Tue Nov 14 18:03:32 2006 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 788A316A40F for ; Tue, 14 Nov 2006 18:03:32 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC51E43D46 for ; Tue, 14 Nov 2006 18:03:30 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (kdqted@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id kAEI3OUE046982; Tue, 14 Nov 2006 19:03:29 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id kAEI3ODW046981; Tue, 14 Nov 2006 19:03:24 +0100 (CET) (envelope-from olli) Date: Tue, 14 Nov 2006 19:03:24 +0100 (CET) Message-Id: <200611141803.kAEI3ODW046981@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, pj@smo.de In-Reply-To: <4559FAD5.2010806@smo.de> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 14 Nov 2006 19:03:29 +0100 (CET) Cc: Subject: Re: Problems with man and less/more X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, pj@smo.de List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Nov 2006 18:03:32 -0000 Philipp Ost wrote: > I just stumbled across a oddity when I use the `man'-command piped > through `less' or `more'. > > What I do is the following: > 1. $ man $some_program > This works without problems. > 2. $ man $some_program | less or: $ man $some_program | more > This works without problems until I type `q' to return to the terminal. > Then the following message appears on the screen[tm] an I get my > shell-prompt: > > Error executing formatting or display command. > system command exited with status 36096 > Error executing formatting or display command. > system command exited with status 36096 > No manual entry for less > $ The man(1) command doesn't like it at all when its pager process gets a "broken pipe" signal. It isn't capable of handling that situation gracefully. You can reproduce the problem without any less(1) involved: $ export PAGER=cat $ man csh | head You will see the same error messages from man(1). > For some man-pages (it seems the category doesn't matter), the message > is two lines shorter: > > Error executing formatting or display command. > system command exited with status 36096 > No manual entry for X > $ It probably depends on the size of the manual page. For short pages, the second less(1) instance reaches EOF before you press "q". > There's no difference whether I use `less' or `more'. They're the same: 465840 -r-xr-xr-x 2 root wheel 109300 Nov 9 10:43 /usr/bin/less 465840 -r-xr-xr-x 2 root wheel 109300 Nov 9 10:43 /usr/bin/more And you can also use head(1), false(1), or "sed 1q", or any other command that will close its standard input prematurely (i.e. before it reads everything through EOF). > My system is 6.2-PRERELEASE with sources from November 12th: The problem is pretty old, I can even reproduce it on a FreeBSD 4.x machine. Normally there is no need to pipe man(1) output through less(1) (why would you want to do that?), so there's no real problem. Just set $PAGER appropriately. By the way, the default (if not set) is "more -s", which is the same as "less -s". Therefore, piping output from man(1) through less(1) doesn't really make sense. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "When your hammer is C++, everything begins to look like a thumb." -- Steve Haflich, in comp.lang.c++