Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

for loop in shell script

for i in {1..5}
do
   echo "Welcome $i times"
done
Comment

For loop in shell script

for i in `seq 1 10`
do
	echo $i #Do something here.
done
Comment

loops 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
for i in {0..10..2}
  do 
     echo "Welcome $i times"
 done
------------------------------------
a=0
# -lt is less than operator
 
#Iterate the loop until a less than 10
while [ $a -lt 10 ]
do
    # Print the values
    echo $a
     
    # increment the value
    a=`expr $a + 1`
done
Comment

PREVIOUS NEXT
Code Example
Shell :: install screen recorder linux 
Shell :: Git - delete specific branch 
Shell :: ssh login 
Shell :: reaect native reactotron 
Shell :: displaying the last line of output bash 
Shell :: npm install -g express 
Shell :: list node running 
Shell :: echo in red color linux 
Shell :: This repository has moved 
Shell :: remove git repository from remote 
Shell :: how to merge text files into one bash 
Shell :: linux change user password 
Shell :: copy from remote server 
Shell :: git push branch to remote 
Shell :: how to remove spaces at end of line linux 
Shell :: enable mods 
Shell :: list users on server 
Shell :: open folder from terminal ubuntu 
Shell :: check gui in linux 
Shell :: update ruby version ubuntu 
Shell :: best code editor 
Shell :: helm release minio 
Shell :: enable option in ubuntu to create document on right click 
Shell :: Deleting all the git local branches 
Shell :: list file sizes 
Shell :: conemu git bash 
Shell :: particular screenshot in ubuntu 
Shell :: copy everything vim 
Shell :: AWS EC2 Stress tool activate on command line 
Shell :: npm install bootstrap 3 angular 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =