While Loop In Bash

[Solved] While Loop In Bash | Perl - Code Explorer | yomemimo.com
Question : shell script while loop example

Answered by : venkatesh

#!/bin/sh
INPUT_STRING=hello
while [ "$INPUT_STRING" != "bye" ]
do echo "Please type something in (bye to quit)" read INPUT_STRING echo "You typed: $INPUT_STRING"
done

Source : https://www.shellscript.sh/loops.html | Last Update : Sat, 15 May 21

Question : while loop shell script

Answered by : breakable-bison-slugdvxuz87h

#!/bin/sh
a=0
while [ $a -lt 10 ]
do echo $a a=`expr $a + 1`
done

Source : https://www.tutorialspoint.com/unix/while-loop.htm | Last Update : Thu, 12 Nov 20

Question : bash while loop

Answered by : agenttequila

#!/bin/bash
i=0
While [ $i -le 10 ]
do echo i:$i ((i+=1))
done

Source : https://hakin9.org/bash-introduction-for-hackers-part-2/ | Last Update : Thu, 02 Jun 22

Question : bash while

Answered by : attractivepenguin

#!/bin/bash
counter=$1
factorial=1
while [ $counter -gt 0 ]
do factorial=$(( $factorial * $counter )) counter=$(( $counter - 1 ))
done
echo "$factorial"

Source : https://www.cyberciti.biz/faq/bash-while-loop/ | Last Update : Tue, 26 Apr 22

Question : While loops in bash

Answered by : 4a729krishnaa

#!/bin/bash
X=0
while [ $X -le 20 ]
do	echo $X	X=$((X+1))
done

Source : http://www.panix.com/~elflord/unix/bash-tute.html | Last Update : Wed, 07 Sep 22

Answers related to while loop in bash

Code Explorer Popular Question For Perl