This shell script is throwing an error message :
syntax error near unexpected token do
Here's my code
#!/bin/bash
DIRS="/home/delhi_qa/mkv/18000/marketview/log/FIFO_OPTIMISER/LOGS 1"
DEST="home/delhi_qa/Tests/Ankit/TTLOGSBACKUP"
DELETE_OLD_ZIP_FILES="no"
BASENAME=/usr/bin/basename
ZIP=/usr/bin/zip
for i in $DIRS
do
#On running this unexpected token message occurred at this line#
zipfile="${DEST}/$(${BASENAME} ${d}).zip"
echo -n "Creating $zipfile..."
if [ "$DELETE_OLD_ZIP_FILES" == "yes" ]
then
[ -f $zipfile ] && /bin/rm -f $zipfile
fi
${ZIP} -r $zipfile $d &>/dev/null && echo "Done!"
done
Can you tell me why?