I can’t figure out what is wrong with following script.
#!/bin/bash
if [ "$1" = "x" ]
then
echo Pushing web on sharada to origin.
else if [ "$1" = "y" ]
then
echo Pulling web on sharada from origin.
else
echo "Usage : arg x to push or y to pull."
fi
I am on linux (Ubuntu) in xterm.
you are missing closing “fi” at the end.
the
else ifconstruct really is not anelifcontinuation, but instead the newiflives within theelseclause of the previousif.so, properly formatted you should have: