martes, 20 de marzo de 2007

{} Abusing the sequence construction

You (should) already know about

$ echo {0..10}

or

$ for i in {0..10};do echo $((i*100));done

We can exploit this combinatory behaviour:

$ echo {0..1}{0..1}
$ bitfactory=;n=8;for((i=0;i<n;i++));do bitfactory+="{0..1}";done; eval echo $bitfactory


Enjoy :)

No hay comentarios: