cmd:info path setup 

Newsgroups: comp.unix.admin
>>I found that /usr/share/info is not in my info path. How can I add
>>it to my default info path? thanks

AFAIK, the GNU info program uses the $INFOPATH environment variable to define the path it'll traverse looking for whatever you're looking info on, similar to the way man uses $MANPATH. The way to set this variable is to set it in one of your shell rc files - You could define it systemwide by defining it in /etc/profile or /etc/csh.cshrc or whatever shell users generally use on your box, or you could simply add it to your own users' rc file…

> Depends on which shell you are using.   If korn shell,
> add    export PATH=$PATH:/usr/share/info  in .profile

Bash'll source .profile, so'll the bourne shell…

Brian Scanlan

cmd:info path setup 

> > AFAIK, the GNU info program uses the $INFOPATH environment variable to define
>
> When I said "default info path", I want to know where is the conf
> file for the default paths.

There is no conf file for the default paths. The default INFOPATH is a compile time setting.

> That's why I want to find the default ones and add my own to it.
>
> Currently, my RH6.2 don't have any INFOPATH setting in system
> setting or my private setting, yet I am able to info most of the
> programs (of cause except those from /usr/share/info).

There's two ways to get the default $INFOPATH…

From the texinfo source ($SRC_ROOT/info/filesys.h)

#define DEFAULT_INFOPATH
"/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:
/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:
/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:
/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:
/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:
/usr/local/lib/emacs/info:/usr/local/emacs/info:."

and by using strace…

$ strace -f -o /tmp/info.out info zoog >/dev/null
Process 21838 attached
Process 21838 detached
info: No menu item `zoog' in node `(dir)Top'.

Do a grep of /tmp/info.out and you can see info looking for the zoog infopage (which of course doesn't exist).

Here's a snippet of the strace output…

21837 stat("/usr/lib/info/dir", 0xbffff9e4) = -1 ENOENT (No such file or
directory)
21837 stat("/usr/lib/info/localdir", 0xbffff9e4) = -1 ENOENT (No such file or
directory)
21837 stat("/usr/local/gnu/info/dir", 0xbffff9e4) = -1 ENOENT (No such file or
directory)
21837 stat("/usr/local/gnu/info/localdir", 0xbffff9e4) = -1 ENOENT (No such
file or directory)

In these cases, /usr/lib/info and /usr/local/gnu/info are present in the default INFOPATH, the dir and localdir files are what info can use to build up a db of what info files are on the system…

Brian Scanlan