Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Was hoping someone can explain what the command to exporting a path variable means?

e.g.:

alias TEST1="/usr/local/test1"

export PATH=$TEST1:$PATH

Does the colon append?

share|improve this question
    
Your syntax is not correct, you don't need the alias keyword. –  enzotib Jan 27 '12 at 16:19

1 Answer 1

$PATH is a variable where bash looks for executables.

It is a list of directories separated by a :

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

So yes you are adding $TEST1 to your path

If you set a variable in a bash shell, the variable is available only within the context of the script. When you export it, it is available outside the script.

See:

http://www.codecoffee.com/tipsforlinux/articles/030.html

http://www.ibm.com/developerworks/linux/library/l-bash/index.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.