From: Colin P. A. <co...@co...> - 2007-07-29 06:52:26
|
>>>>> "Bernd" == Bernd Schoeller <ber...@in...> writes: Bernd> At Sat, 28 Jul 2007 22:58:00 +0200, Bernd> Eric Bezault wrote: >> >> I can confirm that 'sh' should always be in the path on a >> Unix system, >> so just calling 'sh <script>' should always >> work. I am saying "should" >> as there are some very strange >> Unix systems out there ... ;-) >> > >> > So should I use /bin/sh to be 100% sure? >> >> In other words, is there a reason why I shouldn't use /bin/sh? Bernd> Yes, there are: you are taking away the control y the user Bernd> of which sh shell to execute. Some people have their own Bernd> preferred version of 'sh' (for example 'bash' instead of Bernd> the original bourne shell) with a higher priority in their Bernd> path. But it is not their preferred version which is important here - it is the language Eric has written the scripts in that counts. Bernd> But I do indeed think these are corner cases. /bin/sh Bernd> should also do fine. There is also the case of what language the shell-script is written in. If the script uses any bash-specific syntax or features, then you need to execute bash rather than sh. But assuming the script is written for the bourne shell, then sh or /bin/sh is the correct one to use. -- Colin Adams Preston Lancashire |