Reputation: 33
install: bank
if[ -d $(INSTDIR) ];\
then\
cp bank $(INSTDIR);\
echo "Installed in $(INSTDIR)";\
else\
echo "Sorry";\
fi
I am writing this script in install tag and this error is coming. Can anybody suggest what I did wrong,.
error->
if[ -d /home/salman/Desktop ];\
then\
cp bank /home/salman/Desktop;\
echo "Installed in /home/salman/Desktop";\
else\
echo "Sorry";\
fi
/bin/sh: -c: line 6: syntax error near unexpected token `fi'
/bin/sh: -c: line 6: `fi'
make: *** [install] Error 1
Upvotes: 0
Views: 347
Reputation: 135
Please try something like this:
install:
if [ -d $(INCLUDE_INC) ] ; then\
echo "Is a directory $(INCLUDE_INC)";\
else\
echo "Sorry";\
fi
Upvotes: 0
Reputation: 651
Add a space between 'if' and '['. The syntax error is due to space missing.
Upvotes: 1