Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rate Thread Display Modes
Old 09-13-2009, 08:44 AM   #1
K_märkt
Prospect
 
Join Date: Sep 2009
Posts: 10
man command not working

Hi,
I'm very new to unix, so I'm mostly running through various tutorials to get a feel for it. I've stumbled into a problem which I cannot find an answer to in any documentation so far: trying to get to command manuals with man "command" gives the output "No manual entry for 'command'", same with every common command I've tried. The man command itself seems to work, asking for what page I want. Also, I can see various man pages in /usr/share/man. So it seems that man simply do not know where to look. Is it a configuring/PATH problem? Can I (with my very limited knowledge...) fix this? I'm running Mac OS Snow Leopard.
Thanks,
K-märkt
K_märkt is offline   Reply With Quote
Old 09-13-2009, 09:46 AM   #2
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,940
Have you changed anything in your shell configuration? E.g. created a "dot" file in your home folder?
Which shell are you using?

See this Unix FAQ for more info.
__________________
hayne.net/macosx.html
hayne is offline   Reply With Quote
Old 09-13-2009, 10:16 AM   #3
K_märkt
Prospect
 
Join Date: Sep 2009
Posts: 10
Yes, I have a .bash_profile there, containing the single row "export PATH=$PATH:~/bin"; however, I couldn't get to the man pages before I created that either. Perhaps I should remove it anyway?

K_märkt
K_märkt is offline   Reply With Quote
Old 09-13-2009, 01:55 PM   #4
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,940
Quote:
Originally Posted by K_märkt
Yes, I have a .bash_profile there, containing the single row "export PATH=$PATH:~/bin"; however, I couldn't get to the man pages before I created that either. Perhaps I should remove it anyway?

Yes - definitely try removing that file (and all other "dot" files that you created) and then open a new Terminal window.

And by the way, I don't think ~ works when setting PATH like above - try using $HOME instead.
__________________
hayne.net/macosx.html
hayne is offline   Reply With Quote
Old 09-13-2009, 02:18 PM   #5
K_märkt
Prospect
 
Join Date: Sep 2009
Posts: 10
I removed the .bash_profile and opened a new window, but with the same result - no man pages can be found. The "export PATH=$PATH:~/bin" is an example from Enzer's Unix for Mac OS Tiger and it did work for finding the small scripts I had put in the bin folder, but maybe there are more straight forward ways of doing it.
Thanks for the tip on the Unix FAQ, I found it really useful! What I would also like to look at is of course the man man to see how the link between man and the actual man pages look, but... well. Thanks again.
K_märkt is offline   Reply With Quote
Old 09-13-2009, 02:29 PM   #6
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,940
1) Have you made any other configuration changes that would affect the shell? E.g. have you edited any files in /etc ?

2) Try creating a fresh new user account and then log in as that user to see if the problem exists there.

3) If nothing else helps, you could look at what files are opened by the 'man' command - you could do this by running the following command in a different Terminal window while you run the 'man' command:

sudo filebyproc.d | grep man
__________________
hayne.net/macosx.html
hayne is offline   Reply With Quote
Old 09-13-2009, 03:01 PM   #7
Hal Itosis
Hall of Famer
 
Join Date: Apr 2002
Posts: 3,315
I don't have Snow Leopard yet, but i suspect it should be similar to 10.5

What do you get for these two commands?
Code:
$ /bin/cat /etc/manpaths
/usr/share/man
/usr/local/share/man

$ /usr/libexec/path_helper
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/Users/halito/bin:/usr/libexec:/usr/X11/bin"; export PATH
MANPATH="/usr/share/man:/usr/local/share/man:/usr/X11/man"; export MANPATH
-HI-

EDIT: i s'pose we should look at the (system's) profile too... here's mine:
Code:
$ /bin/cat /etc/profile
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
	eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
	[ -r /etc/bashrc ] && . /etc/bashrc
fi

Last edited by Hal Itosis; 09-13-2009 at 03:07 PM.
Hal Itosis is offline   Reply With Quote
Old 09-14-2009, 09:29 AM   #8
K_märkt
Prospect
 
Join Date: Sep 2009
Posts: 10
Thanks for all the suggestions! This is what I've tried so far:

hayne:
1) No, haven't edited any files in /etc or deliberately made any configuration changes - but I saw that some programs I'm using: LaTex, ebiotools etc have created .files in my user directory.
2) I created a new user but with the same result - "No manual entry for xxx".
3) I will try this now.

Hal Itosis:
The first output is identical to yours:
/usr/share/man
/usr/local/share/man

The second output looks like this:
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/opt/local/sbin:/Users/k_markt/molevol/bin:/usr/local/genome/bin:/usr/texbin:/usr/ebiotools/bin"; export PATH;
MANPATH="/usr/share/man:/usr/local/share/man:/usr/X11/share/man:/opt/local/share/man:/usr/ebiotools/share/man"; export MANPATH;

There are some differences here, should I try to change them? If so, how do I do that?

The system's profile output is 30 rows including comments from various software (deleted below):
# System-wide .profile for sh(1)

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/genome/bin"
export PATH

if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi

if [ `whoami` != "root" ]
then
PATH="$PATH:/usr/texbin"
export PATH
fi

if [ `whoami` != "root" ]
then
PATH="$PATH:/usr/local/bin"
export PATH
fi

if [ -f "/usr/ebiotools/etc/profile" ]; then
source "/usr/ebiotools/etc/profile" "/usr/ebiotools"
else
echo "Warning: eBioTools was not initialized because the file /usr/ebiotools/etc/profile could not be found. Please correct this by reinstalling eBioTools or editing /etc/profile."
fi

I do not not know to what extent these differences matter. Do you find any odd things here?
K_märkt is offline   Reply With Quote
Old 09-14-2009, 09:42 AM   #9
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,940
I'd recommend restoring the system-wide file /etc/profile back to what Apple supplied.
Put any of the modifications needed for those 3rd-party programs into your user's ~/.profile instead. (And write to the developers of those 3rd-party programs and chastise them for changing things system-wide.)
__________________
hayne.net/macosx.html
hayne is offline   Reply With Quote
Old 09-14-2009, 01:01 PM   #10
K_märkt
Prospect
 
Join Date: Sep 2009
Posts: 10
Ok, and how do I do that? And are what Apple supplied what I can see in Hal Itosis' output?
K_märkt is offline   Reply With Quote
Old 09-14-2009, 01:26 PM   #11
Hal Itosis
Hall of Famer
 
Join Date: Apr 2002
Posts: 3,315
Quote:
Originally Posted by K_märkt
And are what Apple supplied what I can see in Hal Itosis' output?

That's the stock Apple /etc/profile for Leopard. [i don't have SL yet.]
Hal Itosis is offline   Reply With Quote
Old 09-14-2009, 02:42 PM   #12
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,940
Quote:
Originally Posted by K_märkt
Ok, and how do I do that?

I was hoping that you had a backup (e.g. via Time Machine) of the original /etc/profile file.
__________________
hayne.net/macosx.html
hayne is offline   Reply With Quote
Old 09-14-2009, 03:22 PM   #13
K_märkt
Prospect
 
Join Date: Sep 2009
Posts: 10
Yes, I do, but I don't know how to restore a file from Time Machine that I can't see in the Aqua interface.
K_märkt is offline   Reply With Quote
Old 09-14-2009, 03:37 PM   #14
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,940
You can get to any folder in Finder by using the "Go to Folder" menu item from Finder's "Go" menu, then typing in the path of the folder.
__________________
hayne.net/macosx.html
hayne is offline   Reply With Quote
Old 09-14-2009, 04:15 PM   #15
K_märkt
Prospect
 
Join Date: Sep 2009
Posts: 10
I restored the profile file (identical to the one you showed me above) - and am now browsing some man files. Thanks to you both!

PS. As you advised, I'll try to find a suitable place for the rest of the junk I found in that file.

/K
K_märkt is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump



All times are GMT -5. The time now is 12:00 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.