Am getting an error when running this shell script on a Linux machine:
#!/bin/bash
echo "$2 $1"
if [ $1 = "UNSOLICITED_CANCEL" ]; then
echo "PREVENTIVE MEASURE"
else
echo "test"
fi
echo "done"
The output I get is:
-bash-3.2$ testShellFile2.sh UNSOLICITED_CANCEL pam2 pam3
: No such file or directoryellFile2.sh: line 1: #!/bin/bash
pam2 UNSOLICITED_CANCEL
/home/shells/testShellFile2.sh: line 13: syntax error: unexpected end of file
Am guessing this is an encoding error, but I have tried every encoding available in Notepad and Notepad++. Although, UTF-8 seems to be the only one that lets it run. Please help, thanks in advance.