Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

for in shell script

#!/bin/bash
for i in 1 2 3 4 5
do
   echo "Welcome $i times"
done

#!/bin/bash
for i in {1..5}
do
   echo "Welcome $i times"
done

#!/bin/bash
echo "Bash version ${BASH_VERSION}..."
for i in {0..10..2}
  do 
     echo "Welcome $i times"
 done
Source by www.cyberciti.biz #
 
PREVIOUS NEXT
Tagged: #shell #script
ADD COMMENT
Topic
Name
7+7 =