i've been doing a command line course on codecademy and i get an error that i can't figure out why it's there.
i enter this code in my script.sh file:
01 #!/bin/bash 02 first_greeting="Nice to meet you!" 03 later_greeting="How are you?" 04 greeting_occasion=0 05 06 07 if [$greeting_occasion -lt 1] 08 then 09 echo $first_greeting 10 else 11 echo $later_greeting 12 fi
And when i run on bash i get this:
$./script.sh ./script/sh: line 6: [1: command not found How are you?
I´ve tried changing greeting_occasion
value but the result is always How are you?
with an error on line 6. Also, i tried changing the conditional to start on line 5, and i get the same error on the same line, line 6, and the same result How are you?
.
Any ideas on what´s up in this? Thank you for your time!
apt install shellcheck
.