syntax error near unexpected token [closed]
I was writing a bash script where I faced the below error and I have no idea about the reason:
syntax error near unexpected token `fi'
my script:
#!/bin/bash
if [ 5 -gt 1 ]; than
echo "Hello world"
fi
Try this:
if [ 5 -gt 1 ]
then
echo "Hello world"
fi
You mistyped the keyword "then".