Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I changed the /etc/environment to add more directories to the PATH variable. But looks like $PATH in double quotes were not expanded and I could find any command from the shell and /usr/bin/command-not-found is run.

$ cat /etc/environment 
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
PATH="$PATH:/home/user/technical/java/maven/bin"
JAVA_HOME="/home/user/technical/java/jdk7"

so from the tty,

$ echo $PATH
$PATH:/home/user/technical/java/maven/bin

why did not the expansion happen?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

/etc/environment is shell agnostic. This means it doesn't depend on the way e.g. bash to any expansion.

You can use only the simple key=value assignments here.

share|improve this answer
    
which process reads these key pairs? –  rag Mar 7 '13 at 21:07
    
e.g. look at grep "/etc/environment" /etc/pam.d/* –  H.-Dirk Schmitt Mar 7 '13 at 21:17

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.