add few more for examples, the last two are probably bash specific

This commit is contained in:
Miroslav Franc 2018-09-03 15:54:56 +02:00
parent feab7a9706
commit 146b671412
1 changed files with 18 additions and 0 deletions

View File

@ -10,8 +10,26 @@ do
echo $var
done
# loop over all the JPG files in the current directory
for jpg_file in *.jpg
do
echo $jpg_file
done
# loop specified number of times
for i in `seq 1 10`
do
echo $i
done
# loop specified number of times: the C/C++ style
for ((i=1;i<=10;++i))
do
echo $i
done
# loop specified number of times: the brace expansion
for i in {1..10}
do
echo $i
done