Answers for "loop in shell script file"

7

loop file bash

while read p; do
  echo "$p"
done <peptides.txt
Posted by: Guest on April-06-2020
0

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
Posted by: Guest on April-12-2022

Code answers related to "loop in shell script file"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language