[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Extended syntax conditionals stripped from Here-Documents
From: |
Chet Ramey |
Subject: |
Re: Extended syntax conditionals stripped from Here-Documents |
Date: |
Fri, 03 Oct 2003 11:55:54 -0400 |
> Configuration: --enable-static-link --without-gnu-malloc
>
> Description:
> At least the ${varname+ ... } construct being stripped from
> Here-Documents
> I did not check the other extended syntax conditionals.
I think you're misunderstanding the difference between expansion and
evaluation. The contents of the here document are expanded -- run through
all of the shell's word expansions -- but not evaluated. The `for'
loop is not executed.
All of the ${...} expressions are expanded, but $i will expand to 0, and
we'll look at ${sparseZ[0]} to decide what to expand. Since that's not
set, nothing gets substituted, and the expression apparently disappears.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU chet@po.cwru.edu http://tiswww.tis.cwru.edu/~chet/