[ale] Su Problems

Zot O'Connor zot at ZotConsulting.com
Fri Oct 9 13:47:52 EDT 1998


The answer was not explicitly stated.

The problem is that "su" does not add /usr/sbin and /sbin to your path.

"su -" might, if root if configured with that in it
profile/login/cshrc/bashrc files as people noted.

When you use login (via the console, or ssh) "login" adds those to your
path.

The commands you are looking for as in the sbin directories.

To add it to you path you do the following in bash:
export PATH=$PATH:/sbin:/usr/sbin

I think in csh
setenv PATH=$PATH:/sbin:/usr/sbin

In bash saying variablename=BLAH

Sets "varible name" for the current process.  In a script, that is
throughout the script.

saying "export" tells bash to make this available to further
subprocesses.

An example:
testbash.sh is a simple program as folows:

#!/bin/bash
echo $variablename

[root at eater /root]# variablename=BLAH
[root at eater /root]# echo $variablename
BLAH
[root at eater /root]# ./testexp.sh

variablename is not avaible to the subprocess.  Now if we export it:

[root at eater /root]# export variablename
[root at eater /root]# echo $variablename
BLAH
[root at eater /root]# ./testexp.sh
BLAH

Hope this help more than it confuses.





-- 
Zot O'Connor

www.ZotConsulting.com
www.WhiteKnightHackers.com






More information about the Ale mailing list