[uw.unix] searchpath

dvadura@watdragon.waterloo.edu (Dennis Vadura) (09/06/89)

Ok, how do you get /bin/searchpath to put $HOME/bin FIRST in the searchpath
before other directories.  I want it searched first since I have replaced
some of the brain dead standard tools with slightly fixed versions of the
same standard tools, and want to still call them the same.  I want to use
searchpath to set the path so I can get the benefit of having the same
.login on the various machines.  The man page does not help, I know showpath
exists but can't figure out if it will do the trick since I can't find a
man page for it so I guess showpath does not exist!

Soooooo, Am I destined to not be able to override existing commands with
my own, hmmmmm?

-dennis
-- 
--------------------------------------------------------------------------------
Death is an experience that is best    |Dennis  UUCP,BITNET:    dvadura@water
shared.  [Lt. Worf]                    |Vadura  EDU,CDN,CSNET:  dvadura@waterloo
================================================================================

pfratar@watdcsu.waterloo.edu (Paul Frattaroli - Department of Computing Services) (09/07/89)

In article <16246@watdragon.waterloo.edu> dvadura@watdragon.waterloo.edu (Dennis Vadura) writes:
>Ok, how do you get /bin/searchpath to put $HOME/bin FIRST in the searchpath
>before other directories.  I want it searched first since I have replaced
>
>-dennis
>-- 
>--------------------------------------------------------------------------------
>Death is an experience that is best    |Dennis  UUCP,BITNET:    dvadura@water
>shared.  [Lt. Worf]                    |Vadura  EDU,CDN,CSNET:  dvadura@waterloo
>================================================================================

Hi,
	I'm not sure about searchpath, but what you could try is aliasing
those commands to the ones in your directory.  For example,

	alias command '$HOME/bin/command'

Alias commands of this sort can be put in your .login file or .cshrc
( or .profile if you like Bourne ).  They will be evaluated and put in
the environment each time you logon.

OR....

You could edit your .login or .cshrc file ( which ever contains

	"set PATH= blah blah blah" )

and put "~/bin" first.

....Paul F

-- 
--------------------------------------------------------------------------
            Paul Frattaroli - Department of Computing Services
                        University of Waterloo
< pfratar@watshine.waterloo.edu >         < pfratar@watdcsu.waterloo.edu >

rbutterworth@watmath.waterloo.edu (Ray Butterworth) (09/07/89)

In article <16246@watdragon.waterloo.edu>, dvadura@watdragon.waterloo.edu (Dennis Vadura) writes:
> Ok, how do you get /bin/searchpath to put $HOME/bin FIRST in the searchpath
> before other directories.  I want it searched first since I have replaced
> some of the brain dead standard tools with slightly fixed versions of the
> same standard tools, and want to still call them the same.  I want to use
> searchpath to set the path so I can get the benefit of having the same
> .login on the various machines.

It's a pain to do with searchpath,
and that command is more or less obsolete now.
Use showpath instead.

                setenv PATH `/bin/showpath $HOME/bin standard`

> The man page does not help, I know showpath
> exists but can't figure out if it will do the trick since I can't find a
> man page for it so I guess showpath does not exist!

You set your own MANPATH variable, and so exclude a lot of man pages.

Instead try:

                setenv MANPATH `/bin/showpath $HOME/man standard`

dvadura@watdragon.waterloo.edu (Dennis Vadura) (09/07/89)

In article <28944@watmath.waterloo.edu> rbutterworth@watmath.waterloo.edu (Ray Butterworth) writes:
>In article <16246@watdragon.waterloo.edu>, dvadura@watdragon.waterloo.edu (Dennis Vadura) writes:
>                setenv MANPATH `/bin/showpath $HOME/man standard`

Right, um what came first the chicken or the egg :-)
-dennis
-- 
--------------------------------------------------------------------------------
Death is an experience that is best    |Dennis  UUCP,BITNET:    dvadura@water
shared.  [Lt. Worf]                    |Vadura  EDU,CDN,CSNET:  dvadura@waterloo
================================================================================

dvadura@watdragon.waterloo.edu (Dennis Vadura) (09/07/89)

In article <28944@watmath.waterloo.edu> rbutterworth@watmath.waterloo.edu (Ray Butterworth) writes:
>You set your own MANPATH variable, and so exclude a lot of man pages.
>Instead try:
>                setenv MANPATH `/bin/showpath $HOME/man standard`

WRONG!!!, no dice.  This sets MANPATH to $HOME/man and a bunch of stuff
that man doesn't know about, which has the effect of giving me only
MY manpages and NONE of the others.

So what do I set MANPATH to so that I can READ ALL THE RELEVANT MAN
PAGES!!!! [including showpath :-) (please?)]

-dennis
-- 
--------------------------------------------------------------------------------
The only happy people are Single MEN   |Dennis  UUCP,BITNET:    dvadura@water
and Married WOMEN.                     |Vadura  EDU,CDN,CSNET:  dvadura@waterloo
================================================================================

rbutterworth@watmath.waterloo.edu (Ray Butterworth) (09/07/89)

In article <16259@watdragon.waterloo.edu>, dvadura@watdragon.waterloo.edu (Dennis Vadura) writes:
> In article <28944@watmath.waterloo.edu> rbutterworth@watmath.waterloo.edu (Ray Butterworth) writes:
> >You set your own MANPATH variable, and so exclude a lot of man pages.
> >Instead try:
> >                setenv MANPATH `/bin/showpath $HOME/man standard`

> WRONG!!!, no dice.

Sorry, it was a little late at night for me.
That should have been
                   setenv MANPATH `/bin/showpath $HOME/man standard class=man`

jmsellens@watdragon.waterloo.edu (John M. Sellens) (09/07/89)

In article <16259@watdragon.waterloo.edu> dvadura@watdragon.waterloo.edu (Dennis Vadura) writes:
>In article <28944@watmath.waterloo.edu> rbutterworth@watmath.waterloo.edu (Ray Butterworth) writes:
>>You set your own MANPATH variable, and so exclude a lot of man pages.
>>Instead try:
>>                setenv MANPATH `/bin/showpath $HOME/man standard`
>
>WRONG!!!, no dice.

I think Ray forgot "class=man" - this seems to do the right thing.
       setenv MANPATH `/bin/showpath class=man $HOME/man standard`
In any case, you could always get the showpath man page by unsetting
MANPATH first, which should allow you to figure out how to set MANPATH.

fchan@vlsi.waterloo.edu (Francis Chan) (09/07/89)

In article <16259@watdragon.waterloo.edu> dvadura@watdragon.waterloo.edu (Dennis Vadura) writes:
>>Instead try:
>>                setenv MANPATH `/bin/showpath $HOME/man standard`
>
>WRONG!!!, no dice.  This sets MANPATH to $HOME/man and a bunch of stuff
>that man doesn't know about, which has the effect of giving me only
>MY manpages and NONE of the others.
>
>So what do I set MANPATH to so that I can READ ALL THE RELEVANT MAN
>PAGES!!!! [including showpath :-) (please?)]

Try:
   setenv MANPATH "`/bin/showpath`:$HOME/man:standard"

Man needs those little colons between the paths (showpath has them)

Francis Chan

gbaciu@watcgl.waterloo.edu (George Baciu [CGL]) (09/07/89)

In article <16246@watdragon.waterloo.edu>, dvadura@watdragon.waterloo.edu (Dennis Vadura) writes:
> Ok, how do you get /bin/searchpath to put $HOME/bin FIRST in the searchpath
> before other directories....
> 
> -dennis
> -- 

You can always modify the search path list or just build your
own, although not recommended, by following the /bin/searchpath line
in your ~/.cshrc  with:

	set path = ( $home/bin $path )

This inserts your own bin directory in front of the path list
already available in $path. You can put any other directories in
any order you like, separated by a space, in the brackets.
This order will be preserved.

Now, if you really hate increasing your .cshrc file by
one line then you can get a little more sophisticated by
replacing your /bin/searchpath line with:

setenv PATH "$home/bin:`/bin/searchpath type=users type=x11 type=tex`"

You can add any other available types and flags for the
searchpath command in between ``. You can also append aother
directories as in the following:

setenv PATH "$home/bin:`/bin/searchpath type=users`:$home/myX11:$home/shell"

Note, the separator here is ":".

- George -

jmsellens@watdragon.waterloo.edu (John M. Sellens) (09/08/89)

In article <11418@watcgl.waterloo.edu> gbaciu@watcgl.waterloo.edu (George Baciu [CGL]) writes:
>setenv PATH "$home/bin:`/bin/searchpath type=users type=x11 type=tex`"
Since the tex package is now a default package, you no longer need
type=tex - it's included in type=users.

>setenv PATH "$home/bin:`/bin/searchpath type=users`:$home/myX11:$home/shell"
You can also do this as
    setenv PATH $home/bin:`/bin/searchpath type=users $home/myX11 $home/shell`

To avoid this silliness with searchpath, you can use showpath instead:
    setenv PATH `/bin/showpath $home/bin standard $home/myX11 $home/shell`

jmsellens@watdragon.waterloo.edu (John M. Sellens) (09/08/89)

In article <6286@watdcsu.waterloo.edu> pfratar@watdcsu.waterloo.edu (Paul Frattaroli - Department of Computing Services) writes:
>Alias commands of this sort can be put in your .login file or .cshrc
>( or .profile if you like Bourne ).  They will be evaluated and put in
>the environment each time you logon.
The Bourne shell doesn't have aliases.  Aliases aren't put in the environment,
so if you define them in .login, any non-login shells (e.g. rsh, shell escapes
from vi) will not have those aliases defined.  It's usually best to define
aliases in .cshrc.

>You could edit your .login or .cshrc file ( which ever contains
>
>	"set PATH= blah blah blah" )
>
>and put "~/bin" first.

Don't forget - if you want to ever be able to use MFCF supported software,
you *must* use searchpath or the even better showpath.  If you don't,
be prepared for much heartache and untold mental anguish.

dmcanzi@watshine.waterloo.edu (David Canzi) (09/08/89)

In article <16246@watdragon.waterloo.edu> dvadura@watdragon.waterloo.edu (Dennis Vadura) writes:
>Ok, how do you get /bin/searchpath to put $HOME/bin FIRST in the searchpath
>before other directories.

You do one or the other of the following:

set path = ( ~/bin `searchpath ...` )

		or

setenv PATH $HOME/bin:`searchpath ...`

-- 
David Canzi				"Every solution has a workaround."