Monday, June 22, 2009

bash: single line for loop

run commands on multiple files at once:

[~/hadoop-src] for f in *; do echo $f; done
common
hdfs
mapreduce
[~/hadoop-src]for f in *; do svn up $f/trunk; done
At revision 787534.

Fetching external item into 'hdfs/trunk/src/test/bin'
External at revision 787534.

At revision 787534.

Fetching external item into 'mapreduce/trunk/src/test/bin'
External at revision 787534.

At revision 787534.
[~/hadoop-src]

4 comments:

Leslie Lim said...

Nice article love to read the whole new way of your writing this things.

Shan
www.gofastek.com

laloy_ta said...

The information you shared is remarkable and thus the page is quite revisiting. Keep us informed like this one. Cheers!

www.triciajoy.com

Cindy Dy said...

Very interesting story. I didn't find it boring to read. In fact, I really had a lot of fun reading your post. Thanks.

Bob
www.gofastek.com

lee woo said...

Love it! Very interesting topics, I hope the incoming comments and suggestion are equally positive. Thank you for sharing this information that is actually helpful.


ufgop.org
ufgop.org