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
  • 5,791
  • 5
  • 29
  • 34
Mani Kandan
  • 671
  • 1
  • 9
  • 29

0 Answers0