0

I try to execute the file sample.sh using the command sh sample.sh, which contains the below code:

#!/bin/sh

a=10
b=20

if [ $a == $b ]
then
   echo "a is equal to b"
else
   echo "a is not equal to b"
fi

So when I try to execute I get the below error:

: command not foundine 2:
: command not foundine 5:
sample.sh: line 11: syntax error near unexpected token `fi'
sample.sh: line 11: `fi'

Can someone help me out, where am I going wrong please?

Biffen
  • 6,249
  • 6
  • 28
  • 36
Mani Kandan
  • 699
  • 1
  • 10
  • 30

0 Answers0