Answers for "for loop in linux"

26

for loop in shell script

for i in {1..5}
do
   echo "Welcome $i times"
done
Posted by: Guest on July-08-2020
1

how to use for loop in linux command line

for i in `seq 1 10`; do echo $i; done
Posted by: Guest on June-04-2021
21

for in loop javascript

var person = {"name":"taylor","age":31};
for (property in person) {
	console.log(property,person[property]);
}
//name taylor
//age 31
Posted by: Guest on January-17-2020
0

for loop iteration in shell script

#!/bin/bash
START=1
END=5
echo "Countdown"
 
for (( c=$START; c<=$END; c++ ))
do
	echo -n "$c "
	sleep 1
done
 
echo
echo "Boom!"
Posted by: Guest on July-17-2020
0

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
Posted by: Guest on January-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language