Re: [Nolug] Bash question

From: Friedrich Gurtler <fgurtler_at_gmail.com>
Date: Fri, 20 Apr 2007 14:26:05 -0500
Message-ID: <e9c2c3740704201226w70c3a02dr1a6c647a4021df51@mail.gmail.com>

On 4/20/07, B. Estrade <estrabd@gmail.com> wrote:
>
> I tried various ways to expand the value such that it did the
> implied enumeration, but I could not get it to work.
>

Quoting the manual:

Brace expansion is performed before any other expansions, and any characters
special to other expansions are preserved in the result. It is strictly
textual. Bash does not apply any syntactic interpretation to the context of
the expansion or the text between the braces.

There are patches to bash out there that allow variable substitution in
range expansion, but I doubt anyone is looking to patch bash. So that
particular construct cant be used in this case.

Now, if you wanted to pass in the entire range to the script, instead of the
last letter, you could do this:

./script {A..Q}

And inside the script you do:
VAR = "$@" instead of VAR="$1"

But I see you already have a solution, so its all six one way, half a dozen
the other.

-- Fritz

___________________
Nolug mailing list
nolug@nolug.org
Received on 04/20/07

This archive was generated by hypermail 2.2.0 : 12/19/08 EST