Operating System - Tru64 Unix
1753736 Members
4741 Online
108799 Solutions
New Discussion юеВ

Re: Setting Path

 
SOLVED
Go to solution
Paul Stanard
Regular Advisor

Setting Path

I was wondering is there a way to put the /usr/local/bin path into my users path?
5 REPLIES 5
Johan Brusche
Honored Contributor
Solution

Re: Setting Path

Try
PATH=$PATH:/usr/local/bin
or
PATH=/usr/local/bin:$PATH

or add /usr/local/bin to your .profile
in the line where you define PATH.

or if your a csh addict
set path=(. /bin /usr/ucb /bin /usr/bin /usr/bin/X11 /usr/local/bin /usr/bin/mh /usr/sbin $HOME)
Such line should go into your .login

Johan.

_JB_
Paul Stanard
Regular Advisor

Re: Setting Path

It reads:
if [ ! "$DT" ]; then
stty dec
tset -I -Q
fi
PS1="`hostname`> "
MAIL=/usr/spool/mail/$USER
echo $PATH | /bin/grep -q "$HOME/bin" ||
{
PATH=$HOME/bin:${PATH:-/usr/bin:.}
export PATH
}
Could I just add the lines to the bottom or does it have to go within the brackets?
Sanjay Kumar Suri
Honored Contributor

Re: Setting Path

{
PATH=$HOME/bin:${PATH}:/usr/bin:.:/usr/local/bin
export PATH
}

Confirm the set path after logging again or issue the command .profile.

Use echo $PATH to check if the PATH has been set.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Mark Grant
Honored Contributor

Re: Setting Path

Your .profile seems to give you a different PATH depending on if you already have $HOME/bin in your PATH or not. If this is actually important to you then this will determine where you put your amended PATH.

IF you put it in the brackets, it will only take effect if you don't have $HOME in your path already.

Personally, if you can, I'd comment all that out and just put

export PATH=/usr/local/bin:$PATH at the end of your .profile

As advised above, having done your changes, check it by going ". ./.profile" and then "echo $PATH". Juts make sure it looks right before logging out and in again.
Never preceed any demonstration with anything more predictive than "watch this"
Paul Stanard
Regular Advisor

Re: Setting Path

Thanks to all