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

bash--

Thread Next
From:
H.Merijn Brand
Date:
November 22, 2010 23:49
Subject:
bash--
Message ID:
20101123084943.2d7405dd@pc09.procura.nl
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  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
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.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About