[clug] Rosetta code: bash/bourne shell 'loops' example

Peter Barker pbarker at barker.dropbear.id.au
Sun Mar 21 03:01:27 MDT 2010

On Sun, 21 Mar 2010, steve jenkin wrote:

> I didn't follow their instructions :-(
> In this context, the solutions aren't that clumsy...

I think I prefer this - what I think to be pretty idiomatic:

pbarker at eccles:~$ for i in `seq 1 5`; do for j in `seq 1 $i`; do echo -n 
'*'; done; echo; done
pbarker at eccles:~$

Or did I miss something?

>> steve

Peter Barker                          |   Programmer,Sysadmin,Geek.
pbarker at barker.dropbear.id.au	      |   You need a bigger hammer.
:: It's a hack! Expect underscores! - Nigel Williams

More information about the linux mailing list