Lupisak
Ronny Ager-Wick's blog for techie stuff (GNU/Linux, programming (mostly Ruby, bash), databases, etc)
Friday, 29 June 2012
Linux bash for loop (repeat command n times)
# one liner:
for i in {1..10}; do echo "$i"; done;
# shell script:
#!/bin/bash
for i in {1..10}
do
echo "$i"
done
# note: this works in bash, but *not* in sh.
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)