Jürg Billeter wrote:
> It's right that they gain nothing in the for loops. I've added the 
> "backticks" to the REMOVE_HEADERS lines on purpose, though, as the
> shell doesn't expand braces when defining variables but probably
> there is a better way to get expanded variables, don't know.

Hmm...  You seem to be correct.  About the only way I can get this to
work without the echo and backticks (or $(...)) is to stick an `eval
echo $REMOVE_HEADERS` as the argument of the "rm" command.  But that's
not any better, I don't think.  It's too bad that there's no way to tell
the shell to do brace expansion when assigning variables.  (Normally it
does brace expansion before parameter expansion, so there's no way to do
it when substituting the variable back in.)

I suppose you could do:

for file in linux/{acct.h,...} ; do
    REMOVE_HEADERS="$REMOVE_HEADERS $file"
done

instead of each of your REMOVE_HEADERS="..." lines, but that seems more
wasteful somehow.

(Also note that it doesn't seem to be the quotes that prevent the brace
expansion in the first place, it seems to be the variable assignment.
Even if you do a test like:

VAR=x{1,2,3,4,5}

, without the quotes, then when you echo $VAR, you get x{1,2,3,4,5}, not
x1 x2 x3 x4 x5.  So you'd still need the echo for that no matter how you
set up REMOVE_HEADERS.)

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to