Controlling the executable search path is quite important. There is no "right" answer other than always use the environment variable and not a shell built in (e.g. path instead of PATH).
Scripts run by cron should always use explicit full paths. The best way to do this is to define variables at the beginning of the script and then use those later. For example: AWK=/bin/nawk LS=/bin/ls ${LS} -li | ${AWK} '{print $1 ,$6 ,$10}' There is a lot of system administration lore (e.g. sudo, RBAC) embedded in Solaris which is essential in a large system environment, but not really needed in a small one. Fiddling w/ the root environment is frowned upon because it can have unpleasant consequences when you least want them. Have Fun! Reg --- On Mon, 9/3/12, Armin Maier <ma2...@gmx.de> wrote: > From: Armin Maier <ma2...@gmx.de> > Subject: [OpenIndiana-discuss] PATH Environment Variable: > To: openindiana-discuss@openindiana.org > Date: Monday, September 3, 2012, 4:06 AM > 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. > > _______________________________________________ > OpenIndiana-discuss mailing list > OpenIndiana-discuss@openindiana.org > http://openindiana.org/mailman/listinfo/openindiana-discuss > _______________________________________________ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss