On Wed, Apr 16, 2008 at 9:55 PM, Quanah Gibson-Mount <[EMAIL PROTECTED]> wrote:
>  [EMAIL PROTECTED] build]# su -l zimbra -c "echo $PATH"
> /usr/kerberos/sbin:/usr/local/java/bin:/usr/local/ant/bin:/usr/local/mysql/bin:/usr/local/ant/bin:/usr/local/java/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/build/bin:/usr/local/p4/bin
>
>  This means of course, that using "su -l <user> -c command" will fail to
> execute commands that should be found in the user's path, necessitating that
> one use a fully qualified path to the command.

Greetings,

You are using a double quote which will expand the $PATH variable
before switching to the user zimbra. See this example:

[EMAIL PROTECTED] ~]# su -l noland -c "echo $PATH"
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[EMAIL PROTECTED] ~]# su -l noland -c 'echo $PATH'
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/noland/bin

Here is another example which shows this:

[EMAIL PROTECTED] ~]# echo su -l noland -c "echo $PATH"
su -l noland -c echo
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[EMAIL PROTECTED] ~]# echo su -l noland -c 'echo $PATH'
su -l noland -c echo $PATH

Respectfully,
Brock


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to