develooper Front page | perl.perl5.porters | Postings from November 2010


Thread Next
H.Merijn Brand
November 22, 2010 23:49
Message ID:
First off, I'm a tcsh user, so I don't follow sh/ksh/bash changes ...

I saw in the changelog of xterm, an alarming line:

      o prefer ${name:=value} to ${name-value}, since recent bash changes
        break legacy support for that feature.

Coincidentally, I recieved two commit posts for meta (dist)

 * Taught metalint about "${var:" type syntax.
 * Added lookup for nawk.

OK, so there is a syntax I didn't know about. ${var:=foo} seems to be
the new ${var-foo}. I have no idea why that was changed, by whom, and
when. I checked on my oldest OS, and saw that even HP-UX 10.20 supports
both forms. So does (maybe even more surprising) AIX 5.2.

In Configure, there seems to be only one single line that uses
${var-foo} syntax:

$ grep -P '\$\{\w+-' Configure
        echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"

There is no such thing in either hints or *.SH. We use ${var:=foo} in
none of the files I scanned.

So, if OS's as old as HP-UX 10.20 supprt it, and we can expect bash to
barf on the ${foo-default} syntax any time soon, would it be wise to
alter that line?

H.Merijn Brand      Perl Monger
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.3 and AIX 5.2 and 5.3. 

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About