From eefa3add633ef1e80fb7403eec7854da1077188b Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Fri, 5 Sep 2014 20:51:48 -0500 Subject: Add traditional for loop bash example to close https://github.com/adambard/learnxinyminutes-docs/pull/654 --- bash.html.markdown | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bash.html.markdown') diff --git a/bash.html.markdown b/bash.html.markdown index 57fb5c55..dc7d32b6 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -8,6 +8,7 @@ contributors: - ["Denis Arh", "https://github.com/darh"] - ["akirahirose", "https://twitter.com/akirahirose"] - ["Anton Strömkvist", "http://lutic.org/"] + - ["Rahil Momin", "https://github.com/iamrahil"] filename: LearnBash.sh --- @@ -140,6 +141,12 @@ do echo "$VARIABLE" done +# Or write it the "traditional for loop" way: +for ((a=1; a <= 3; a++)) +do + echo $a +done + # They can also be used to act on files.. # This will run the command 'cat' on file1 and file2 for VARIABLE in file1 file2 -- cgit v1.2.3