Command Line - if syntax error

I am stuck in this step for some time, I have followed the instructions but couldn’t get it to work.

if [ condition]
  echo xxx
  echo xxx

Why do it keep saying “fi” is syntax error?
Also I have to add set ff=unix otherwise the command output will say bad interpreter

Usually that would mean it doesn’t recognize that as a command…
I don’t know what code language you are using, but did you spell your command on line 11 incorrectly or use it wrong?

I think it works now! Apparently there seems to be a bug that the online bash environment doesn’t recognise the script. I reported the bug and it works perfectly :slight_smile:

1 Like