LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-12-2003, 05:52 PM   #1
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
bash line wrapping gone awol


ever since i installed gentoo i had a niggle about bash (i think it's bash... not really sure who's fault it is) where rather than formatting a manpage like http://thirtythreeandathird.net/goodman.png which happens if i ssh to my server and look at a man page, i get something like http://thirtythreeandathird.net/badman.png . From what i can gather the $COLUMNS variable is not being reported correctly inside a shell script or something in that vein as it happens with other scripts too, such as http://thirtythreeandathird.net/scrollbar from the bash examples scripts. Some *very* vaguely related threads on the net point a finger at readline, but that's not exactly my problem....

any ideas??

Last edited by acid_kewpie; 05-12-2003 at 05:53 PM.
 
Old 05-12-2003, 05:57 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Gidday Chris!

Not sure where I'm getting this one from,
but all of a sudden terminal type (as in
vt100, vt102, ...) pops into my head ...

termcap, terminfo :)

Cheers,
Tink

Last edited by Tinkster; 05-12-2003 at 05:59 PM.
 
Old 05-12-2003, 10:44 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
I had the same problem a year ago. The problem/solution is in man itself (would you believe 'man man' for more info?). The command is something like 'man -c <command>' to reformat the display. Anyhow, try 'man man' or 'info man' for more info.
 
Old 05-13-2003, 12:10 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Original Poster
Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
man pages were the best example i could think of, but it is in other areas too, on any shell, i'ev looked through the man pages and fiddled with -c, nada....

don't know if my post was cofusing tink, but it's the local terminal that is formatted badly, not the remote one...

Last edited by acid_kewpie; 05-13-2003 at 12:19 PM.
 
Old 05-13-2003, 03:33 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I think I understood that Chris ...

what I meant is: what is your local terminal
identifying itself as?

eg ... if I telnet (yeah, I know, it's not my fault)
to one of our Dec unix hosts and do a man
it comes back to me telling me my terminal
of type linux is unknown and thus isn't fully
functional. When I locally start a xterm -ti linux&,
and do a man man, I get a horribly garbled output :)
and even reset won't clean up the mess...

Cheers,
Tink
 
Old 05-13-2003, 04:23 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Running:
stty -a

Should tell you the terminal width. "man stty" talks about setting the number of columns but I have never needed to know that so I can't help much there.
 
Old 05-13-2003, 04:37 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Original Poster
Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
hmm, ok i've been digging around an awful lot and i *think* i've traced it back to man itself, or more specifically groff version 1.18 which (maybe only on gentoo) ignores one of the man formatting commands, namely .ll which sets the line length. i'm not sure if this is gentoo specific or not, and i'd really appreciate it if someone 1) not on gentoo and 2) with groff 1.18 or 1.18.1 could confirm wether their manpages do get automatically resized to match the width of their terminal. thanks.

sorry if i confused you saying it wasn't just man as i was sure it wasn't. arse.
 
Old 05-13-2003, 05:06 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
A man page on my rh9 system with groff 1.18.1 wraps perfectly at column 78.

Hope this helps!
 
Old 05-13-2003, 06:10 PM   #9
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
OK - I've done some checking/playing with groff and I am able to change my default man width to 50 cols by using:
NROFF /usr/bin/nroff -c -mandoc -rLL=50n

instead of:
NROFF /usr/bin/nroff -c -mandoc

in my /etc/man.config.

Also after reading the groff man pages it looks like it should default to 78 cols if there is no override.

A simple grep:
grep -R "ll 78n" /usr/share/groff/*

Shows the following files hold the default values.
/usr/share/groff/1.18.1/tmac/an-old.tmac:. ie n .nr LL 78n
/usr/share/groff/1.18.1/tmac/an-old.tmac:. ie n .nr LT 78n
/usr/share/groff/1.18.1/tmac/doc-old.tmac:. nr ll 78n
/usr/share/groff/1.18.1/tmac/doc-old.tmac:. ll 78n
/usr/share/groff/1.18.1/tmac/doc-old.tmac:. nr lt 78n
/usr/share/groff/1.18.1/tmac/doc-old.tmac:. lt 78n
/usr/share/groff/1.18.1/tmac/mdoc/doc-nroff:.ll 78n
/usr/share/groff/1.18.1/tmac/mdoc/doc-nroff:.lt 78n
/usr/share/groff/1.18.1/tmac/mdoc/docj-nroff:.nr ll 78n
/usr/share/groff/1.18.1/tmac/mdoc/docj-nroff:.ll 78n
/usr/share/groff/1.18.1/tmac/mdoc/docj-nroff:.nr lt 78n
/usr/share/groff/1.18.1/tmac/mdoc/docj-nroff:.lt 78n

To change my man pages I can edit the LL line in:
/usr/share/groff/1.18.1/tmac/an-old.tmac

To the value I want to make the default (if you do this there is no need to edit /etc/man.config).

Hope that all makes sense - I have never done it before but from the tests I have carried out - it does work for me and hopefully you too
 
Old 05-14-2003, 03:20 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Original Poster
Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
interesting, i would be fairly confident that this is a bug of some sort, but can't for the life of me understrand how this hasn't been fixed if that is the case... it's surely not a deliberte thing...!? if you try downgrading to 1.17 (and removing the -c from the NROFF statement in man.conf) then you should find that your manpages perfectly fit the termainl, whatever the width of the window. there's no way AFAIK to make that default command depend on the width. man builds up a real long command line and just uses set values for nroff / groff... thanks for looking into it... it can be fun getting your hands dirty.
 
Old 05-14-2003, 05:04 AM   #11
mhearn
LQ Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 57
Try this:

shopt -s checkwinsize

then resize the xterm and then run man again.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash shell script read file line by line. Darren[UoW] Programming 57 04-17-2016 06:07 PM
BASH: read every line in the files and use the line as parameters as another program tam3c36 Programming 10 12-07-2010 01:42 PM
bash prompt wrapping problems c0uchm0nster Linux - Software 3 09-29-2005 06:07 PM
Minimal Bash-Like Line jlwilso SUSE / openSUSE 1 03-09-2005 12:39 PM
line wrapping in terminal emetib Linux - General 4 10-29-2003 09:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration