for loop in shell script
for i in {1..5}
do
echo "Welcome $i times"
done
for loop in shell script
for i in {1..5}
do
echo "Welcome $i times"
done
loop bash
years=(2018 2019)
days=(74 274)
for year in "${years[@]}"; do
for day in $(seq -w ${days[0]} ${days[1]}); do
echo $year
echo $day
done
done
bash for loop
for VARIABLE in file1 file2 file3
do
command1 on $VARIABLE
command2
commandN
done
bash for i
for VARIABLE in 1 2 3 4 5 .. N
do
command1
command2
commandN
done
For loop in shell script
for i in `seq 1 10`
do
echo $i #Do something here.
done
for in bash
C-like for loop
for ((i = 0 ; i < 100 ; i++)); do
echo $i
done
Basic for loop
for i in /etc/rc.*; do
echo $i
done
Ranges_1
for i in {1..5}; do
echo "Welcome $i"
done
Ranges_2
for i in {5..50..5}; do
echo "Welcome $i"
done
reading lines
cat file.txt | while read line; do
echo $line
done
infinity loop
while true; do
whatever you want to do
done
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us