On my Ubuntu install I get root path (as expected) when passed as you have
using singles, personal user path (also as expected) when using double
quotes. I have a basically untouched new install and as dragorn indicates,
it could differ.

I personally would anticipate it to return the root path when called in
this manner, but again, dragorn has excellent points.

JC


On Mon, Nov 12, 2012 at 12:06 AM, Adam <[email protected]> wrote:

> I ran across a strange inconsistency today.  What should
>
>     su -l -c 'echo $PATH'
>
> return when run by an ordinary user (who happens to know the root
> password) at the bash prompt?  Under Mandriva and CentOS it returns the
> user's path, but under Debian it returns root's path.  I don't understand
> the inconsistency or which response is correct, but that would seem to make
> some shell scripts non-portable.
>
> Adam
>
> ______________________________**_________________
> Mid-Hudson Valley Linux Users Group                  http://mhvlug.org
> http://mhvlug.org/cgi-bin/**mailman/listinfo/mhvlug<http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug>
>
> Upcoming Meetings (6pm - 8pm)                         Vassar College
>  Dec 5 - SysAdmin Panel
>  Jan 9 - High Performance Computing
>  Feb 6 - February Meeting
>



-- 
Eschew obfuscation and pompous prolixity.

Light a man a fire, he is warm for the night.
Light a man afire, he is warm for the rest of his life.
_______________________________________________
Mid-Hudson Valley Linux Users Group                  http://mhvlug.org
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug

Upcoming Meetings (6pm - 8pm)                         Vassar College
  Dec 5 - SysAdmin Panel
  Jan 9 - High Performance Computing
  Feb 6 - February Meeting

Reply via email to