I have been trying to write a while loop bash script that will check the size of two directories, and echo that out to a text file in the www folder. After my while loop stubbornly refused to work, I decided to simplify it to make sure I could get aa basic "if statement" to work, but for some reason after hours of frustration, even with the most basic of if statements, it will not work. Any idea what I am missing?
echo "hello World" # a=1 b=2 echo "A: $a" echo "B: $b" if [ "$a" -eq "$b" ]; then echo "equal" else echo "Not equal" fi
Every time I run that, I get this error:
test.sh: line 12: syntax error near unexpected token `fi'
test.sh: line 12: `fi'
If I put "exit" or "done" at the end of the file, it tells me unexpected end of file.
Thanks so much!