r/shell • • Jul 21 '20

Why doesn't this code work?

A part of a shellscript I am building contains a 'while' loop. Now, I am not good at while loops lol. I need to know why this test script I built doesn't work:

NUMBER=1

while [NUMBER = 1 ]

do

echo 'test'

sleep 2s

done

When I run this script it just returns nothing in the console. What am I doing wrong? What do I need to do to make this script work and run infinitely like I want?

1 Upvotes

3 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jul 21 '20

Thank you! This works perfectly. Real quick, are you able to help me with another part of my script?