FAQ: Learn Bash Scripting - Loops

I am side-by-side doing these exercises in my own Ubuntu script.sh file.
When I put the initial “while” example in, it tells me it’s expecting a unary operator around the “-lt”

Any ideas?

Same thing happened to me. I kept getting the error message telling me to nest the if…fi in the do, and to increment. After changing it multiple times, indenting the if…fi part as many different ways I could think of, I tried running the script in the terminal too. It didn’t work. The given solution looked exactly like how I thought I had it, which made feel better. I, too, which I had copy/pasted what I had, because it looked to be the same.

You got that right, I been coding for 2 months and sometimes my mind goes blank as to what the exercises are asking, but I take a step back for a break, reassess and come back to keep trying. it is difficult but not impossible. Keep it up, coding is more than a set of instructions, it is an art form