Re: Non-POSIX shells



Sander Vesik wrote:

> Umm... no - you just can't realy on anything beyond the capabilities
> provided by Bourne shell (or equivalent) in shell scripts that have to be
> portable.

Which Bourne shell would that be? The old ones (in Ultrix, for example)
didn't have functions, so even scripts as simple as glib-config would fail
on that. :-)

> If it is not a shell script that gets run directly, just call it
> shellscript.sh.in and have configure replace the #! POSIX_SHELL@ at the
> top or something similar...

The problem is that writing portable shell scripts is a black art. You can
do it sucessfully if you test on a lot of systems.

If you try to stick to POSIX semantics (and do the above autoconf trick),
you'd most likely run into the same problem that started this thread.

Modern shells which are (or can be) POSIX compliant usually have
extensions. So if a script works in bash it won't necessarily work in
ksh. Figuring out if a script uses only POSIX constructs (and if all
invoked utilities use POSIX constructs) involves testing on different
systems. I don't know a way around that.

-- 
 .-.   .-.    I don't think for my employer.
(_  \ /  _)
     |        dave willfork com
     |



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]