Re: variable in loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



From: S Mathias <smathias1972@xxxxxxxxx>

> $ 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.................................................................
> What  am i missing?

$ for i in {1..3}; do echo $i; done
1
2
3
$ a=3; for i in {1..$a}; do echo $i; done
{1..3}

Try with:
for ((i=1;i<=$a;i++))

JD


      
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux