experchange > linux-general

nipsu (01-15-05, 02:49 AM)
can someone post the Mandrake 10.1's path because i overwrited it. thank
you.

--
Bit Twister (01-15-05, 03:12 AM)
On Sat, 15 Jan 2005 02:49:00 +0200, nipsu wrote:
> can someone post the Mandrake 10.1's path because i overwrited it. thank
> you.


What do you mean you overwrote it. The path's are kept in files
so you logout and login it should be restored. There are several files
which make up the path. If you dinked one up tell us which one.
nipsu (01-15-05, 03:49 AM)
>If you dinked one up tell us which one.

im not so sure, put this line is on my path currently.

/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin

i have just installed mandrake. i think i lost something from the path when
playing with it.
Bit Twister (01-15-05, 04:07 AM)
On Sat, 15 Jan 2005 03:49:53 +0200, nipsu wrote:
>>If you dinked one up tell us which one.

> im not so sure,


You need to start keeping an admin diary indicating what file
and before and after changes. Also does not hurt to make a backup
file, Example: cp /what/ever /what/ever_orig and /what/ever_bkupX

> put this line is on my path currently.
> /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
> i have just installed mandrake. i think i lost something from the path when
> playing with it.


Looks kind of close to mine. You could add :/usr/games and I would put
the /sbin after /user/sbin if it was me. I
nipsu (01-15-05, 10:01 AM)
in what files is the path held? when i put my jdk/bin to path it disappears
from there when i switch users and do other stuff maybe. how i can set it
to stay there?
Bit Twister (01-15-05, 10:23 AM)
On Sat, 15 Jan 2005 10:01:40 +0200, nipsu wrote:
> in what files is the path held?


Depends on what shell you are running. Try doing a
man $(basename $SHELL)
or
man `basename $SHELL`

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.

I would place site/custom global environment variables
in /etc/profile.d/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 environment variables are set are
/etc/X11/xinit.d/
/usr/share/config/kdm/Xsession
/usr/share/config/kdm/kdmrc
/etc/X11/Xsession

If you do not want to follow the code, you can put echo commands in
the top and bottom of each of the command files used during login to
see what is changed where.

Click up two terminals, one for root and one for your user account (rseku)

When you login using the bash shell, the first file to run is
/etc/profile and the other files are /etc/bashrc, ~/.bash_profile and
~/.bashrc.

> when i put my jdk/bin to path it disappears
> from there when i switch users and do other stuff maybe. how i can set it
> to stay there?


cd /etc/profile.d

touch zz_local.sh
chmod 755 zz_local.sh

Now add any variable you wish to export in zz_local.sh

zz_local.sh was picked so that it would run last.

After you modified zz_local.sh, test it by clicking up a terminal
su -l nipsu
echo $VAR $PATH
you added in /etc/profile.d/zz_local.sh
exit # logs out of nipsu
Similar Threads