On Sun, 2007-04-01 at 00:01 -0700, Alec Warner wrote: > One idea that comes to mind is /usr/bin/env $bin
And here we return to the problem that one day /usr/bin/env, could become /bin/env... Or that /usr/ sometimes is not mounted during boot. Thus, well. Seems that have sane PATH in the beginning of script is the best solution. On Sun, 2007-04-01 at 03:09 -0400, Mike Frysinger wrote: > On Sunday 01 April 2007, Alec Warner wrote: > > For cron, one would need to set the PATH to something sane though. > > i thought sane cron systems would setup a sane PATH for you: > /sbin:/usr/sbin:/bin:/usr/bin At least fcron does not have default PATH compiled in. It inherits PATH from environment. When we start fcron from init.d system it has some default path set from /etc/init.d/function.sh (as Roy pointed). Well. Thank you all for your answers. At least now I know that I have not overlooked something trivial and seems that the best solution is to set PATH={PATH}:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin in the beginning of all shell scripts and to avoid usage of full path to executable. -- Peter.
signature.asc
Description: This is a digitally signed message part