variable in loop

Sam Sharpe lists.redhat at samsharpe.net
Sun Jan 2 23:14:51 UTC 2011


On 2 January 2011 22:27, S Mathias <smathias1972 at yahoo.com> wrote:
> $ ASDF=hello; a=0; a=$(( 70 - $(echo $ASDF | awk '{print length}') )); echo "$a $ASDF"$(for i in {1..$a}; do printf "."; done)
> 65 hello.
> Why doesn't it print:
> 65 hello.................................................................

Because {1..$a} doesn't output the sequence 1..65 like you think it
should. Replacing it with `seq 1 $a` does.

> What am i missing?

To be honest... the point of this list - elementary Bash programming
isn't a matter for the Fedora Users list.

-- 
Sam


More information about the users mailing list