Home > Archive > alt.os.linux > October 2002 > add path to environment variable path





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author add path to environment variable path
Markus Falkensteiner

2002-10-05, 8:25 am

Hi NG,

a simple stupid question.

how can i add an entry to my environment variable PATH.

is "set" the rigth command for. how must i use this command.

Thx in advance

Markus


Bit Twister

2002-10-05, 8:25 am

On Sat, 5 Oct 2002 14:35:51 +0200, Markus Falkensteiner wrote:
> Hi NG,
>
> a simple stupid question.
>
> how can i add an entry to my environment variable PATH.
>
> is "set" the rigth command for. how must i use this command.



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 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_pa
th

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.


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
http://www.pathname.com/fhs/2.2/fhs-3.12.html
Urs Karger

2002-10-06, 2:24 am

On Saturday 05 Oct 2002 12:40 Bit Twister wrote:

> [..]


That is correct if Markus uses bash. Otherwise replace bashrc with the
correct filenames. And instead of "export" the "set" command is also used
in some shells. With echo $SHELL you can see what shell you use.

greetings urs
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net