$PATH variable question

$PATH variable question

Post by holyroguesp » Sun, 28 Apr 2002 08:45:53



I just installed the latest version of Samba but I guess I did it wrong.  
Every time I need to run a command, I have to be in the correct directory
of Samba.  How do I set the $PATH variable?  I looked but can't find the
solation.

thanks

 
 
 

$PATH variable question

Post by Bit Twist » Sun, 28 Apr 2002 08:54:39



> I just installed the latest version of Samba but I guess I did it wrong.  
> Every time I need to run a command, I have to be in the correct directory
> of Samba.  How do I set the $PATH variable?  I looked but can't find the
> solation.

Global for everyone
        /etc/profile - environment variables (PATH, USER, LOGNAME,...)
        /etc/bashrc  - contains function & aliases, not environment vars

I would place site/custom global environment variables in xx_local.sh
That way you can pop xx_local.sh in on new installs.

If you have an /etc/profile.d directory; do a

cd /etc/profile.d
touch xx_local.sh
chmod 755 xx_local.sh
Then add your changes, Example:  export PATH=$PATH:new_path:another_path

User only
        ~userid_here/.bash_profile - for environment variables
        ~userid_here/.bashrc       - for function & aliases, not env vars

ALWAYS do a    su -l user_id      to test your changes before logging out.

Profiles usually run once, bashrc run everytime you spin up a non-login
interactive session.

Sessions inherit env vars from the parent process.

Setting BASH_ENV=~/.bashrc will cause it to execute during
non-interactive session.

PS:
        for extra points do a
        man bash