[CentOS] variable in loop
Les Mikesell
lesmikesell at gmail.comSun Jan 2 23:05:27 UTC 2011
- Previous message: [CentOS] variable in loop
- Next message: [CentOS] variable in loop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 1/2/11 4:27 PM, 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)
> 65 hello.
> $
>
>
> Why doesn't it print:
> 65 hello.................................................................
>
>
>
> What am i missing?
>
Order of operations. Brace expansion happens before variable substitution
(echo $i to see the actual value you are getting).
--
Les Mikesell
lesmikesell at gmail.com
- Previous message: [CentOS] variable in loop
- Next message: [CentOS] variable in loop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list