Re: Non-POSIX shells



On Tue, 5 Mar 2002, Drazen Kacar wrote:

> 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. :-)
> 

The real thing that came with V7 of course 8-)

> > 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.
> 

no, you need to use a minimal shell script (or a csh script that doesn't
use tcsh extensions) that detects a suiatble shell and replaces...

> 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.

This is no different than not using all the exciting extensions to the C
language your compiler provides. 8-)

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

	Sander

	I see a dark sail on the horizon
	Set under a dark cloud that hides the sun
	Bring me my Broadsword and clear understanding





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