Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!mcsun!ukc!mucs!logitek!grep!vic From: vic@grep.co.uk (Victor Gavin) Newsgroups: comp.unix.sysv386 Subject: Re: Less misbehaves when used for "man" pager... Message-ID: <1991Apr25.095207.21898@grep.co.uk> Date: 25 Apr 91 09:52:07 GMT Article-I.D.: grep.1991Apr25.095207.21898 References: <30370@cs.yale.edu> Reply-To: vic@grep.co.uk (Victor Gavin) Organization: Grep Limited, LEEDS, UK Lines: 38 In article <30370@cs.yale.edu> fields-doug@CS.YALE.EDU (Doug Fields) writes: >I have been running less (can't say which version but it's recent. 1.90 >perhaps?) sicne i've been running SCO Xenix and moved to SCO Unix. When >I edit the /etc/default/man so that it uses less for the pager instead >of pg, and you try to read a un-formatted man page (I installed the TPS >from Xenix on my Unix), less will spew out a ton of warnings about things >the terminal can't do, such as scroll backwards, etc. This has happened from >both SCO products, 3.2.2 Unix and 2.3.3 Xenix. Is the TERM environment variable >somehow misplaced or something? If you look in the /etc/default/man file you'll see that there is a variable called TERM which is set to (normally) lp. The man command reads this and reset your true TERM to this value. This is why less complains about not being able to understand your terminal. You can verify this by running a subshell from less and echoing TERM. The reason the SCO reset TERM from within /etc/default/man is to allow for the command /usr/man/bin/nr which is invoked to format manual pages which aren't in preformated form. TERM is then passed to the nroff command (which isn't supplied with SCO !). To fix this I just changed all occurrences of TERM in /etc/default/man and /usr/man/bin/nr to MTERM and edited the binary /usr/bin/man and replaced all occurrences of TERM=\0\0 with MTERM=\0. I was able to do this because the strings are 0 padded to the nearest 4byte boundary, so that to add a new letter, I had to remove one of the 0's. If there hadn't been a spare \0 to remove, then renaming the variable would have been sufficient (eg TERM -> MRET). Remember to save your original man command. vic PS Since we've got a network of machines here, I have a shell script called nroff that calls nroff on another machine. Works great :-) -- Victor Gavin