Hi all,
Usually I work in X environment (XCFE) with extensive use of x terminal; concretely, I use Gnome-terminal. Sometimes I change to root to do some admin tasks. But often it seems a few commands are not availables. The key is in the $PATH value:
echo $PATH (in login shell, interactive ): /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/root/bin
echo $PATH (in gnome-terminal, no-login interactive shell): /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/jordi/bin
The last path in $PATH variable shows me that the problem would be the gnome-terminal doesn't update correclty the $PATH when I change to root through "su" command.
¿What do you think about?
TIA.
On Sat, January 13, 2007 8:43 pm, Jordi Espasa Clofent wrote:
Hi all,
Usually I work in X environment (XCFE) with extensive use of x terminal; concretely, I use Gnome-terminal. Sometimes I change to root to do some admin tasks. But often it seems a few commands are not availables. The key is in the $PATH value:
echo $PATH (in login shell, interactive ): /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/root/bin
echo $PATH (in gnome-terminal, no-login interactive shell): /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/jordi/bin
The last path in $PATH variable shows me that the problem would be the gnome-terminal doesn't update correclty the $PATH when I change to root through "su" command.
¿What do you think about?
TIA.
su -
will do the trick.
Jordi Espasa Clofent wrote:
Yes Marko, it works fine now. ¿Can you explain why?
From `man su`: "The optional argument - may be used to provide an environment similiar to what the user would expect had the user logged in directly."
I think it simply re-runs the bash rc scripts for the user you change to.
-pu
On Sun, January 14, 2007 11:31 pm, Patrick Useldinger wrote:
From `man su`: "The optional argument - may be used to provide an environment similiar to what the user would expect had the user logged in directly."
I think it simply re-runs the bash rc scripts for the user you change to.
Actually, it starts the shell as a login shell. This will execute /etc/profile and /etc/.profile (which are only executed for login shells). Normally it won't (and in the case of bash it will execute bash-specific stuff like .bashrc).
-- Daniel