Author Topic: System commands help is displayed instead of functions help in Linux?  (Read 7979 times)

SyRenity

  • Community Member
  • Posts: 9
  • Hero Points: 0
Hi.

Is there a way to make SE to show a man of a function, instead of a system command (when there is one with the same name)? For example, trying to show the help for the stat() function brings the stat command, and not the function description.

I think it's because the stat command man page is higher in priority then the function man page, but this only a guess.

Thanks.
« Last Edit: July 06, 2006, 08:01:17 PM by SyRenity »

Kohei

  • Senior Community Member
  • Posts: 192
  • Hero Points: 25
Hi.

Is there a way to make SE to show a man of a function, instead of a system command (when there is one with the same name)?

You might want to give the section number to the command, like this

Code: [Select]
man 2 stat
This should display the system call stat, instead of the user command version.

HTH,
Kohei

SyRenity

  • Community Member
  • Posts: 9
  • Hero Points: 0
Thanks for the tip. Is there a way to make SE to show the correct man pages?

Kohei

  • Senior Community Member
  • Posts: 192
  • Hero Points: 25
Since SlickEdit simply executes the system "man" command and displays its output, what you need do is to change the section search order that your man command follows.  You could control the section search order at several different levels.  To do it globally, become a super user and edit /etc/man.config.  Find the parameter named MANSECT.  Its value should look like 1:8:2:3:4:5:6:7:9:0p:1p:3p:tcl:n:l:p:o .  Simply move the 2 before the 1, and save the file.  This way section 2 is always searched before section 1, and in the case of the stat command, you would always get the stat system call, not the stat shell command.  This also applies when you execute the man command within SlickEdit.

If you don't want the change to be global or you don't have a super user account on your system, you can set the MANSECT environment variable to something like 2:1:8:3:4:5:6:7:9:0p:1p:3p:tcl:n:l:p:o by
Code: [Select]
export MANSECT=2:1:8:3:4:5:6:7:9:0p:1p:3p:tcl:n:l:p:othen the change is limited only to the current session.

If you even want to limit the change to a certain workspace within SlickEdit, go to Project > Workspace Properties > Environment, and set the MANSECT value therein.  This way, the change only affects that specific workspace.

SyRenity

  • Community Member
  • Posts: 9
  • Hero Points: 0
Thank you for the explanation. Eventually I started using the command line "man X function_name", because some of the functions are located on the 3 index.