variable in loop

MR ZenWiz mrzenwiz at gmail.com
Mon Jan 3 01:33:28 UTC 2011


On Sun, Jan 2, 2011 at 3:16 PM, Smoot Carl-Mitchell <smoot at tic.com> wrote:
> On Sun, 2011-01-02 at 14:27 -0800, S Mathias wrote:
>> ASDF=hello; a=0; a=$(( 70 - $(echo $ASDF | awk '{print length}') ));
>> echo "$a $ASDF"$(for i in {1..$a}; do printf "."; done)
>
> The brace expansion {1..$a} occurs before variable expansion.  The
> result you get for the value of the range is {1..65} which is not what
> you expect.

Why are we still doing this fellow's homework for him?




More information about the ubuntu-users mailing list