variable in loop

Nils Kassube kassube at gmx.net
Mon Jan 3 06:46:47 UTC 2011


MR ZenWiz 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)

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

Because maybe it isn't homework but really someone trying to learn bash 
programming? In that case I would suggest to get the bash manual e.g. 
from <http://www.gnu.org/software/bash/manual/> or something on paper 
like the O'Reilly book "Learning the bash shell" by Cameron Newham & 
Bill Rosenblatt.

OTOH, it really looks like homework.


Nils




More information about the ubuntu-users mailing list