Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

man output does not persist on console

0 views
Skip to first unread message

Rahul

unread,
Apr 11, 2008, 12:10:35 PM4/11/08
to
When I "man" a command, say "man cut", I get the manpage on my screen.
After I press a "q" it disappears. It used to be convenient for the last
man-text-screen to remain on my console for reference while I typed on
the subsequent command line. It used to; but I must have messed
something up because now it doesn't.

Any suggestions? I have neither MANPAGER nor PAGER explicitly set in my
shell.


--
Rahul

Dave Uhring

unread,
Apr 11, 2008, 1:56:57 PM4/11/08
to

Then export PAGER=more; it must have defaulted to less.

Rahul

unread,
Apr 11, 2008, 2:36:11 PM4/11/08
to
Dave Uhring <daveu...@yahoo.com> wrote in news:h-
udnWsUh8H0O2Lan...@supernews.com:

>
> Then export PAGER=more; it must have defaulted to less.
>

Thanks Dave! That solved it. I didn't realize that this was a more vs less
issue!

--
Rahul

Chris F.A. Johnson

unread,
Apr 11, 2008, 2:51:14 PM4/11/08
to

There is an option to less (keep it in $LESS) that changes this
behaviour. Check the man page; I forget which option it is.


--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence

Moe Trin

unread,
Apr 12, 2008, 2:12:13 PM4/12/08
to
On Fri, 11 Apr 2008, in the Usenet newsgroup comp.os.linux.misc, in article
<Xns9A7D8A62688E...@85.214.90.236>, Rahul wrote:

>Dave Uhring <daveu...@yahoo.com> wrote

>> Then export PAGER=more; it must have defaulted to less.
>
>Thanks Dave! That solved it. I didn't realize that this was a more vs
>less issue!

It isn't. It's a terminal initialization function, and is further
dependent upon how your version of less is configured. Find some
document, and display it with

less document

When you exit, the screen will be redrawn back to the way it was, and
paged output of less will be gone. Then try

less -X document

The '-X' is detailed in the man page:

-X Disables sending the termcap initialization and deinitial-
ization strings to the terminal. This is sometimes desir-
able if the deinitialization string does something unneces-
sary, like clearing the screen.

Notice the last sentence. If you only want this behavior to occur when
reading man pages, reset the PAGER variable in /etc/man.conf appropriately.
If you want the behavior to be global to your user, set the LESS variable
in your shell login script.

LESS='-X'; export LESS

but read the 'less' man page under the 'OPTIONS' section to see how such
options are parsed. In theory, you can also screw with the termcap
settings, but it's probably not worth the hassle.

Old guy

Rahul

unread,
Apr 12, 2008, 3:30:14 PM4/12/08
to
ibup...@painkiller.example.tld (Moe Trin) wrote in
news:slrng01urr.m...@compton.phx.az.us:

> -X Disables sending the termcap initialization and deinitial-
> ization strings to the terminal. This is sometimes desir-
> able if the deinitialization string does something unneces-
> sary, like clearing the screen.
>
> Notice the last sentence. If you only want this behavior to occur
> when reading man pages, reset the PAGER variable in /etc/man.conf
> appropriately. If you want the behavior to be global to your user, set
> the LESS variable in your shell login script.
>
> LESS='-X'; export LESS

Ah! Now I understand. -X is the behavior I always wanted with less. I
had seen the -X option in the manpage before. But I never connected that
sentence to the effect it produces. Thanks Moe!

--
Rahul

0 new messages