Skip to main content
added 56 characters in body
Source Link
mrts
  • 19.4k
  • 9
  • 100
  • 80

The code should be as follows (note the shebang says bash, not sh):

#!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {01..10..1};   do echo "Welcome $i times" done 

sourceYou can use {0..10..1} if you want to start from 0.

Source: http://www.cyberciti.biz/faq/bash-for-loop/.

The code should be as follows (note the shebang says bash, not sh):

#!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {0..10..1}; do echo "Welcome $i times" done 

source http://www.cyberciti.biz/faq/bash-for-loop/

The code should be as follows (note the shebang says bash, not sh):

#!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {1..10}  do echo "Welcome $i times" done 

You can use {0..10..1} if you want to start from 0.

Source: http://www.cyberciti.biz/faq/bash-for-loop/.

deleted 21 characters in body
Source Link
alper
  • 3.5k
  • 13
  • 64
  • 127

The code should be as follows (note the shebang says bash, not sh):

 #!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {0..10..1} do echo "Welcome $i times" done 
#!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {0..10..1}; do echo "Welcome $i times" done 

source http://www.cyberciti.biz/faq/bash-for-loop/

The code should be as follows (note the shebang says bash, not sh):

 #!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {0..10..1} do echo "Welcome $i times" done 

source http://www.cyberciti.biz/faq/bash-for-loop/

The code should be as follows (note the shebang says bash, not sh):

#!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {0..10..1}; do echo "Welcome $i times" done 

source http://www.cyberciti.biz/faq/bash-for-loop/

Fix trivial typos
Source Link
Jonathan Leffler
  • 759.4k
  • 145
  • 961
  • 1.3k

iThe code should be as follows (note the shebang says bash, not sh):

 #!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {0..10..1} do echo "Welcome $i times" done 

source http://www.cyberciti.biz/faq/bash-for-loop/

i code should be as follows

 #!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {0..10..1} do echo "Welcome $i times" done 

source http://www.cyberciti.biz/faq/bash-for-loop/

The code should be as follows (note the shebang says bash, not sh):

 #!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {0..10..1} do echo "Welcome $i times" done 

source http://www.cyberciti.biz/faq/bash-for-loop/

Source Link
Pradheep
  • 3.9k
  • 2
  • 30
  • 36
Loading