koala_man 1371858127 learn Counting to 10 for different shells: for i in {1..10}; do ... (bash3+ for small constants), for ((i = 1; i <= 10; i++)); do ... (bash 2.04+/zsh/ksh93), i=; while ((i++ <= 10)); do ... (bash/mksh/ksh88), i=; while [ $(( ( i += 1 ) <= 10 )) -ne 0 ]; do ... (POSIX) ormaaj 1420629194 forget ormaaj 1420629213 learn Basic loops: Bash/Zsh/ksh93: «for ((i = 0; i < 10; i++)); do ...; done», For small constants: «for i in {0..9}; do ...; done» ksh: «i=0; while ((i++ < 10)); do ...; done», POSIX: «i=0; while [ $((i += 1)) -lt 10 ]; do ...; done» http://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Conditional_Loops ormaaj 1420629986 forget ormaaj 1420630073 learn Basic loops: Bash/Zsh/ksh93: «for ((i = 0; i < 10; i++)); do ...; done», For small constants: «for i in {0..9}; do ...; done» ksh: «i=0; while ((i++ < 10)); do ...; done», POSIX: «i=0; while [ "$i" -lt 10 ]; do ...; i=$((i + 1)); done» http://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Conditional_Loops kurahaupo 1631422615 forget kurahaupo 1631422615 learn Basic loops: Bash/Zsh/ksh93: «for ((i = 0; i < 10; i++)) do …; done», For small constants: «for i in {0..9}; do …; done» ksh: «i=-1; while ((++i < 10)); do …; done», POSIX: «i=-1; while i=$((i + 1)); [ "$i" -lt 10 ]; do …; done» http://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Conditional_Loops emanuele6 1658328595 forget emanuele6 1658328634 learn Basic loops: Bash/Zsh/ksh93: «for ((i = 0; i < 10; i++)) do …; done», For small constants: «for i in {0..9}; do …; done» or «i=-1; while ((++i < 10)); do …; done», POSIX: «i=-1; while i=$((i + 1)); [ "$i" -lt 10 ]; do …; done» http://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Conditional_Loops emanuele6 1658328661 forget emanuele6 1658328696 learn Basic loops: Bash/Zsh/ksh93: «for ((i = 0; i < 10; i++)) do …; done» or «i=-1; while ((++i < 10)); do …; done», For small constants: «for i in {0..9}; do …; done», POSIX: «i=-1; while i=$((i + 1)); [ "$i" -lt 10 ]; do …; done» http://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Conditional_Loops