scripting environments (was: /bin/date and coreutils)

Vincent Lefevre vincent-opdarw at vinc17.org
Fri May 11 17:26:54 PDT 2007


On 2007-05-11 20:25:24 +0200, Elias Pipping wrote:
> Indeed, I'm missing the point. So... make a script that can live with the 
> bourne shell invoke /bin/sh then

The script must be compatible with both Bourne and POSIX shells
(because under Solaris, /bin/sh is a Bourne shell).

> and if it can't, make it invoke '/usr/bin/env bash' because if bash
> needs to be invoked at all cost, that's the best way to do it.

Then it's better to invoke "/usr/bin/env perl", which is much more
powerful than bash. BTW, you can't implement things like timeouts
(e.g. if some command takes too much time to complete) in POSIX
shells, because if you want to trap a signal, then the trap function
will be executed only when the current command has terminated!

-- 
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



More information about the macports-users mailing list