>: >>How do I get /sbin:/usr/sbin into PATH automatically when using the
>: >>su from the shadow password suite? It is somewhat annoying to
>: >>su to root for administration but not having many of the admin
>: >>commands in your PATH. The man page doesn't mention any file
>: >>to control this - do I have to hack the source?
>: >Try using su - root instead of just su root. This dash gives you the
>: >environment of the user that you want to become instead of just the uid.
>: Thanks, but that also dumps me in root's home directory which is
>: seldom where I want to be.
> So what? Just cd back to wherever you are going! Its hardly a major
>task - especially since you were considering hacking the source so a normal
>su (without the '-') would automatically give you the path of the account
>you had su'ed to!
Not only is it a major task when you are in some very/long/path/over/some/
nfs/mounts but it is annoying when you forget and admin commands that
call other commands fail because they don't have a reasonable PATH. Note
that I don't necessarily want root's login environment or the PATH
set by anyone's start-up files. I just want a reasonable PATH which
I don't get by default after using su. I wouldn't mind if it left
my existing PATH alone (but I understand why some people think otherwise)
or if it gave me something that included the stock admin commands.
Quote:> Some people are never satisfied!
Nor should they be with less than reasonable program behaviour. Especially
when other systems get this right out of the box. Fortunately, however,
suggested changing the defaults in /etc/login.defs. Fixing
ENV_SUPATH does the trick. Now I'm just surprised that the man page
for su didn't mention this file.