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

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
Comment

PREVIOUS NEXT
Code Example
Shell :: npm otp-generator 
Shell :: how can I use eog command in windows subsystem linux? 
Shell :: stop all docker machiens 
Shell :: please install all available updates for your release 
Shell :: how to assign a value to a variable in batch script using powershell 
Shell :: github create directory 
Shell :: ssh rembeber password 
Shell :: windows kill process running on port 
Shell :: adb install aab 
Shell :: how to curl a service inside a pod in kubernetes? 
Shell :: ssh: could not resolve hostname gitlab.example.com: name or service not known 
Shell :: jenkins local 
Shell :: pendrive bootable using terminal 
Shell :: shreck 
Shell :: how to permantely install library in collab 
Shell :: i wrongly deleted code , can i retrieve through git command 
Shell :: check if server has alreday AD 
Shell :: router dom react 
Php :: tinker color disabled 
Php :: laravel query not null 
Php :: wordpress get template url 
Php :: brew remove php 
Php :: the requested PHP extension curl is missing from your system. 
Php :: update php version using htaccess 
Php :: php remove dashes from string 
Php :: php date + one day 
Php :: php reading a file line by line 
Php :: strtoupper in php 
Php :: hide wordpress error 
Php :: convert one time zone datetime value to another using php 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =