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
you are missing closing "fi" at the end.
the else if
construct really is not an elif
continuation, but instead the new if
lives within the else
clause of the previous if
.
so, properly formatted you should have:
#!/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
fi # <-- this closes the first "if"