[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: PATH variable



On Tue, 8 Oct 2002, Andre Kirchner wrote:

> Hi there,
> 
> is the a file where I can made a change in the PATH
> variable which will be available for all the users?


You can edit /etc/profile, but the preferred method is to add a file 
in the directory /etc/profile.d.

For instance, I have this file in profile.d:

$ cat /etc/profile.d/java.sh 
#!/bin/sh

export JDK_HOME=/usr/local/java
export JAVA_HOME=/usr/local/java
PATH=$PATH:$JDK_HOME/bin




Your file has to end in .sh for it to work, because the files there are
called from /etc/profile like this:

for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        . $i
    fi
done



-- 
Hope this helps,
Arend





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]