Shell Scripting Tutorial-39: The 'while' Loop

preview_player
Показать описание
In this tutorial we'll learn to use the while loop to display ten numbers on screen. The 'while' loop is my favorite loop and I am sure you will be able to appreciate it's usefulness as well as we move along.
Рекомендации по теме
Комментарии
Автор

Very Practical, well explained and to the point....thanks my friend

ramirez
Автор

It makes sense, but what about looping while a variable is equal to TRUE ?

techwithdave
Автор

how do i break out of a always true while loop? for quitting out of the app without using ctrl c?

Автор

Hi,

I am using the same code as you are but I am getting an error

below is the code snippet

count = 1
until [ $count -ge 10 ]
do
echo $count
count = `expr $count + 1
done




but I am getting error count

1- count not found
2- -ge unexpected error.


help me out.

JaiSingh-qnmc
Автор

You don't actually need expr.

count=1
while [ $count -le 10 ]
do
echo $count
count=$((count + 1))
done

VarunKalia
Автор

Hello sir please upload video about alphabet patter using VI editor in Linux if possible upload today because tomorrow is my practical exam that's
A
AB
ABC
This way

sankalpinfotech
Автор

I am running the same script as yours but getting error
Illegal number 1+1

charulbhardwaj
Автор

count=1
while [ $count -le 10 ]
do
    echo $count
    count =`expr $count + 1`
done

while executing am getting this error. plz help me. am using REHL4

siraj
Автор

Hmm for this one I get an error...

expr: syntax error
while.sh: line 5: [: -le: unary operator expected

FoneStar
Автор

Your tutorial are very good, really, but you speak too fast.

qadeharpotter
Автор

stop trying to use american colloquial language...especially with this indian accent...Preferably stop using english....there are many channels with proper english... It's better to stick to hindi for you guys

spandansaha
join shbcf.ru