[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Portability of shell parameter expansions (${word%pattern} and frien
From: |
Benoit Sigoure |
Subject: |
Re: Portability of shell parameter expansions (${word%pattern} and friends)? |
Date: |
Tue, 6 Nov 2007 15:33:49 +0100 |
On Nov 6, 2007, at 3:25 PM, Ralf Wildenhues wrote:
* Benoit Sigoure wrote on Tue, Nov 06, 2007 at 03:13:07PM CET:
Anyone aware of any portability issue with shell parameter
expansions?
Solaris 10 /bin/sh knows neither
${foo#bar}
${foo%bar}
${#foo}
Grrr, Solaris 10 is such a pain in the ass. I'll stop to use of
parameter expansions then. Is there any trick to achieve something
similar in pure Sh without resorting to external commands such as
expr or sed? The Windows machines I use are like twice (or even 4
times) more powerful than the other Linux machines, yet they take
twice the time to build the same thing. I've seen configure scripts
taking more than an hour to complete on a P4 2.6Ghz. So I'm really
trying hard to avoid unecessary forks.
By the way, while we're at it, how portable is $((math expression))?
It also saves lots of forks compared to `expr whatever`.
Last time this issue was raised, the Solaris limitation was still
considered too "common knowledge" for it to end up in the manual.
We may want to reconsider that.
Heh, maybe the manual should mention it then. I'll try to propose a
patch.
You may want to have a look at the _LT_PROG_XSI_SHELLFNS macro of
Libtool HEAD, at the end of
<http://cvs.savannah.gnu.org/viewvc/libtool/libltdl/m4/libtool.m4?
root=libtool&view=markup>
Thanks.
--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
PGP.sig
Description: This is a digitally signed message part