[OpenIndiana-discuss] PATH Environment Variable:

Jim Klimov jimklimov at cos.ru
Mon Sep 3 11:52:21 UTC 2012


2012-09-03 13:06, Armin Maier пишет:
> Hello Indiana's :)
>
> I have configured Openindiana to be able to login as root without first
> login as an unprivileged user and after that run sudo. Now i had a
> problem within a Script (chmod command) and found out that the $PATH
> variable is different from signing in with "sudo su". I know the reason
> is the "~/.profile" Script where "/usr/gnu/bin" is added in front of the
> PATH variable, but what is the reason for this behavior? Until now i was
> not aware of that but i can imagine that this could make  troubles in
> scripts scheduled by cron for example.


Well, this was one point of discomfort for either Solaris-way people
or GNU-liking folks. OI chose to have a friendlier GNU userland as
priority, and sets Sun utilities secondary in PATHs.

Nothing keeps you (and me) from reversing this on every installation
and zone you make, but it is a nuisance for the Sun-worshippers (or
those who need the specific Solaris functionality, like support of
ZFS ACLs in chmod, ls, cpio and others).

As for scripts, they should ensure the paths they need anyway.
If they don't - they are poorly coded ;)

And mind that PORTABLE scripts using /sbin/sh should not expect bash or
ksh behavior, they should work within limits of old bourne shell ;)

//Jim




More information about the OpenIndiana-discuss mailing list