man command and silly behavior
Hello guys,
I was wondering if you have ever experienced such problem: I have the man command that when launched from root doesn't show every man page, but from normal user it displays them without any problem. For instance it does this silly behavior with the command useradd, showing a blank file when called from root and it show the correct man page when called from normal user.. Quote:
Quote:
Quote:
Quote:
What could be the reason? |
you need either use ls /usr/man/man8/useradd* or ls /usr/man/man8|grep useradd, but do not add * in this grep pattern.
you can try strace -f -o /tmp/strace.log man useradd and check how man tried to look for those files. |
Thanks for the help pal... in the log indeed they are accessing two different files:
From Root: Quote:
Quote:
Quote:
man /usr/man/cat8/useradd.8.xz Quote:
[ installed ] - shadow-4.1.5.1-i486-3_slack14.1 [ installed ] - bash-completion-2.1-noarch-1 but no luck so far... what can it be? also, why is adding * in the grep pattern a bad thing? :) Your answer has been very helpful thanks! |
My solution has been to replace the gz file with the xz and of course I changed the type of archive.. works fine so it should be fine..
|
the * has a special meaning and it is not what you need. Otherwise it causes no problem in your case.
I would suggest you to run that strace for both useradd and usermod (and for both root and user) and find the differences. I think there is a permission problem or an environment variable was not set properly... |
I know what you mean about * but in that case works fine either way.. though your suggestion is more correct..
What is curious is why I have the user* man in both directories /usr/man/man8 and /usr/man/cat8 with a different archive extension.. |
Quote:
On a more general point: Do the cached man-pages actually add any value these days? Processors are a damn sight faster than they used to be, so reformatting time is going to be unnoticeable, and the cached pages only get created/used on a 80 column wide display anyway, which I suspect doesn't match what most of us are using on a regular basis (mine is typically 159). Probably best to just set NOCACHE in man.conf and do away with the cat dirs completely. And speaking of man.conf, what is it doing in /usr/lib64? Wouldn't /etc be far more appropriate? |
Quote:
|
Anymore, the cat directories are empty (Slackware 14.1) -- they live in /var/man and there are symbolic links to each directory (cat1 - cat9 and catn) in /usr/man. For a long time there were two sets of manual pages, one set with the man macros, the other, the cat pages, as formatted text. And, of course, there are multiple languages so you'll see man pages in the language specified by your locale. See man man for a description. The purpose was to cut down on the formatting time of manual pages to a simple text file and that was done automatically when the man utility was invoked (or you could force it, building all the I]cat[/I] pages in one go. Nowadays, why bother.
Manual pages are written using the man macros, embedded codes that specify how to display text. The codes are of the form at the beginning of a line followed by one or more characters. You can see what an unformatted manual page looks like with, say Code:
zmore /usr/man/man8/useradd.8.gz Code:
man groff_man As to the use or non use of the asterisk with the find utility: it's better to enclose arguments in single quotes when using the asterisk; e.g., Code:
find /usr/man -type f -name 'useradd*' If you like to have hard copy of a particular manual page, you can invoke Code:
man -t useradd | lp What the -t argument does is "typeset" a document (the output is PostScript), which you pipe to your printer. The published books written by the likes of Dennis Ritchie, Brian Kernighan and others at AT&T Bell Labs were all written using text macros for formatting (as with the manual macros). You have all of these for creating tables, equations, graphs, formatted text and so on on your Slackware system. The rules are real simple:
Code:
nroff file Hope this helps some. |
Quote:
|
Quote:
Mine are all empty (and I do read man pages fairly often), seems like the cat "feature" is shut off by default and I really wouldn't want to turn it back on anyway. Stuff changes, methinks, sometimes for the better, sometimes for the worse. |
Seems that in order for them to be created, as well as having to be on a 80 column terminal, you also need to be root, (probably due to the permissions on the directories), which may go some what to explaining why the few pages that existed in my system were for things like lilo(8).
|
thanks for the explanation tronayne. Really cool!
|
Quote:
|
Quote:
|
All times are GMT -5. The time now is 04:04 AM. |