manipulating $PATH variable
Hi all,
I set the $PATH variable using set PATH = .......... My question is how do i remove items from the $PATH variable and say, change their order? Thanks |
Man,
Your question has too many answers. Each one who posts here will give you one solution. If you want to change the order of the path for a specific script, may be the best is to put the preferred paths in front of the path list which you have. By the command you used as example, I suppose you are using C shell. I don't know its syntax to give you an example. But in bourne shell, from which bash is descendant, suppose I have this path: PATH=/usr/bin:/bin:/usr/sbin:/sbin:.... and we want some script to look first in /sbin, but maintain all the search path, we would do: PATH=/sbin:$PATH We could compose an editor for the path, but we would spend too much effort before the task to be done. |
Thanks for your reply.
|
Bash has certain words that are "built in" to it.........."set" and "unset" are just two of them............."export" is another built in word.
IF your doing something specific like building an LFS system......you'll need to set a $PATH variable to use on a temporary basis.......example Code:
export $LFS=/LFS |
Hi 320mb,
I would want alert you your command has an extra dollar; you have to enter Code:
export LFS=/LFS Code:
cd $LFS |
All times are GMT -5. The time now is 09:34 AM. |