experchange > redhat

Terence (10-03-03, 01:36 AM)
How does one go about setting up a path variable in linux?

The gtk-config script installed by GTK could not be found
If GTK was installed in PREFIX, make sure PREFIX/bin is in
your path, or set the GTK_CONFIG environment variable to the
full path to gtk-config.

I also get bash - command not found errors in attempting to run
some programs in the linux terminal.
Bit Twister (10-03-03, 02:53 AM)
On Thu, 02 Oct 2003 23:36:57 GMT, Terence wrote:
> How does one go about setting up a path variable in linux?


Depends on distribution

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

You can place functions in the profile if you want to export the
function name. Example export -f function_name_here.

It is instructive to read the files in /etc/profile.d, if you have one.

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

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

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

The zz_local.sh name was picked to force it to be executed last.
/etc/profile runs the scripts in /etc/profile.d
do a ls -1 /etc/profile.d to see order of file execution.

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.

You can place functions in the .bash_profile if you want to export the
function name. Example export -f function_name_here.

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.

Other places may be in
/etc/X11/xinit.d/
/usr/share/config/kdm/Xsession
/usr/share/config/kdm/kdmrc

PS:
for extra points do a
man bash
Similar Threads