LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-19-2010, 06:33 PM   #1
klenot
LQ Newbie
 
Registered: Sep 2010
Location: Prague, Czech Republic
Posts: 13

Rep: Reputation: 0
how to switch man formatting to left-aligned?


I installed openSuSE 11.3.

By default, man pages blocks are justified (block-aligned). Example:

Code:
WARNING
      Improper use  of this  command may seriously
      damage  your system,  so  read  this  manual
      carefully  to   understand  how  to  use  it
      correctly   and   prevent   yourself    from
      destroying your system.
Instead, I would like all manual pages would be displayed left-aligned, like this:

Code:
WARNING
      Improper use of this command may seriously
      damage your system, so read this manual
      carefully to understand how to use it
      correctly and prevent yourself from destroying
      your system.
Is there some easy way to achieve it?

I definitely would not like to reformat all the manual pages one-by-one. but rather just changing sometnihg in some macro-definition file or something similar? .. Is it possible achieve that simply and quickly?

Thx for explanations and/or advices.

Last edited by klenot; 09-19-2010 at 06:35 PM.
 
Old 09-20-2010, 03:27 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Try this:
Code:
man --nj man
Hint: even man has a man page.
 
1 members found this post helpful.
Old 09-20-2010, 05:00 PM   #3
klenot
LQ Newbie
 
Registered: Sep 2010
Location: Prague, Czech Republic
Posts: 13

Original Poster
Rep: Reputation: 0
David,

I have read the 'man man' carefully before posting here, also I read the 'info man', and searched for strings 'justify', 'left', 'align', but did not found anything interesting.

Your advice seems to be pretty simple. However, it does not works with my man. It does not recognize the '--nj' option:
Code:
bea:/gss # man --nj man
man: unrecognized option `--nj'
Try `man --help' or `man --usage' for more information.
bea:/gss # man -V
man 2.5.2
bea:/gss #
What version of Linux and man do you use? My setup is openSuSE 11.3 and man version 2.5.2.

Last edited by klenot; 09-20-2010 at 08:38 PM.
 
Old 09-21-2010, 01:30 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Well, that's odd. Must be a relatively new option then. My version of man is up to 2.5.7. --nj is the short form of the --no-justification option.

It looks to me like openSuSE is still using a fairly old version of the coreutils. Unless there are different forks/versions of it floating around with different options.
 
1 members found this post helpful.
Old 09-22-2010, 12:16 AM   #5
klenot
LQ Newbie
 
Registered: Sep 2010
Location: Prague, Czech Republic
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks David, the H.

David,

I downloaded the debian man v2.5.7, converted it to .rpm (by "alien" perl script) and installed it.

Code:
root@bea:/tmg # rpm -ivh --force man-db-2.5.7-4.i386.rpm
Preparing...                ########################################### [100%]
   1:man-db                 ########################################### [100%]
/var/tmp/rpm-tmp.AnyEmD: line 3: /usr/share/debconf/confmodule: No such file or directory
warning: %post(man-db-2.5.7-4.i386) scriptlet failed, exit status 1
root@bea:/tmg # man -V
man 2.5.7
root@bea:/tmg #
Then I did set the option '--nj' into my .bashrc file:
Code:
export MANOPT=--nj
.. and now it works as I wanted.

Thank you for all your input.

Btw.: I think the man is not part of coreutils, but a separate project.

Btw.2: man v2.5.2 is 2.5 months old. (built at July 05th, 2010).

Nevertheless, what do you think about that error message:

/usr/share/debconf/confmodule: No such file or directory

I think, it is caused by the fact, that the package was converted from .deb format. I hope, it should not affect my system any significant way. Am I right ? .. man works .. everything else works .. Should I care of that error message ?
 
Old 09-22-2010, 06:33 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
A pity you already updated. I'd like to see a "-nj" not "--nj" since the shorthand notation customarily uses but one "-". Just maybe that would have worked...
 
Old 09-22-2010, 01:40 PM   #7
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Ok, my bad. I could've sworn I saw it listed in the coreutils description. Besides, it just seemed natural that it should be there.

I tried searching for a changelog also, but as I was looking for the wrong package it's understandable that I failed to find it. Now I have, and according to /usr/share/doc/man-db/changelog.gz it was first added in November of last year, along with --no-hyphenation, in between versions 2.5.6 and 2.5.7.

Speaking of which, do be careful not to confuse the build date with the release date. The SuSE package may be only a few months old, but the changelog lists version 2.5.2 as having been released in May 2008, while 2.5.7 came out in February.

Anyway, debconf is the Debian package configuration system, so yes, it's an artifact of the alien conversion. I don't think it should hurt anything, as it mostly just means the package script couldn't find the configuration tools it expected. But since it seems that all the files went to the right place and it's working properly, it's probably nothing to worry about.

If you want to however, you can grab the source code here and build it yourself from scratch: http://savannah.nongnu.org/projects/man-db


@JZL240I-U: My understanding is that single-hyphen options are generally limited to single characters. Since "nj" is two characters, it still needs to use the double-hyphen long-option style.

Last edited by David the H.; 09-22-2010 at 01:42 PM.
 
Old 09-23-2010, 12:36 PM   #8
klenot
LQ Newbie
 
Registered: Sep 2010
Location: Prague, Czech Republic
Posts: 13

Original Poster
Rep: Reputation: 0
just a few notes..

JZL240I-U,

I have tried the single dash '-nj' switch in OpenSuSE 11.3 Live CD boot (with man v2.5.2, originally contained in the OpenSuSE 11.3 distro). It does not recognize it. Nor it is mentioned in its "man man" pages. The man v2.5.2 simply cannot left-align the content.

David the H.,

Thank you for pointing out that the build date of some prog in a distro must not be the same as its release date.

Concerning building the man from source: I am not so strong in compiling, so I decided to go the simpler and quicker way (installing the ready-made package). But I will try to compile it from source.
 
Old 09-24-2010, 12:55 AM   #9
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Okay, I tried it out for myself on SuSE 11.2, didn't work either. Sorry to point you in the wrong direction . May 2008 is rather old considering, that there have been several releases since then.

Last edited by JZL240I-U; 09-24-2010 at 01:01 AM.
 
Old 09-24-2010, 01:42 PM   #10
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Actually, I'm kind of surprised that there's still active development going on, considering how venerable the man system is. Who would've guessed that new features like this are still being added? Impressive.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bios screen not aligned to the left (resolution problem?) soldan Slackware 13 10-20-2006 03:03 AM
Formatting and Mounting Left Over Partition Wheat_Thins Linux - Software 5 05-21-2006 11:56 PM
how to produce a text file from man w/o formatting? spyghost Linux - Newbie 2 07-30-2003 06:05 PM
Man Page Formatting nxny Linux - General 7 01-06-2003 07:59 PM
MAN page formatting incorrect via telnet/SSH pederslie Linux - Newbie 3 12-11-2002 02:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:08 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