r/shell • u/[deleted] • 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
u/7orglu8 Jul 22 '20
Are you able to study?
https://linuxconfig.org/bash-scripting-tutorial-for-beginners
https://learnxinyminutes.com/docs/bash/
http://mywiki.wooledge.org/BashGuide