I wrote a script and parts of the script are as follows:
#!/bin/bash
if [ "$1" == "this_script" ] then
this_script --parameters
elif [ "$1" == "other_script" ] then
other_script --parameters
else
echo "missing argument"
fi
When I run this script, I get the error,
syntax error near unexpected token `elif'
`elif [ "$1" == "SWDB" ] then'
1) Is it an issue with line endings? I wrote the script with Notepad++ on Windows BUT i have enabled the EOL conversions under Edit to UNIX/OSX format.
2) If not line endings, what is the error?
I am running this script in bash shell on a Redhat Linux OS.