Hi All,
I am beginner in scripting. I wrote a simple script to perform some task. It seem to have some error in command line,
Kindly somebody help.
Thanks
#!/bin/bash
date
cd /home/poojasaxena/Desktop/CMS/script/DataMCMatch
function pause(){
read -p "$*"
}
FILE=$1
TARGETPATH=$2
max=2
for ((i=1; i<=$max; ++i )) ;
do
echo "$i ..."
cp $FILE $TARGETPATH
#cp DataMC.sh temp.sh
if[ $i == 1] ;
then
echo "for first set of files"
sed -e 's/file1.list/file2.list/g' card_Data2011AB_Zee_40GeV > card_Data2011AB_Zee_40GeV_1
sed -e 's/file1.root/file2.root/g' card_Data2011AB_Zee_40GeV_1 > card_Data2011AB_Zee_40GeV_2
mv card_Data2011AB_Zee_40GeV_2 card_Data2011AB_Zee_40GeV
echo "its done"
source $TARGETPATH
pause 'Press [Enter] key to continue...'
rm $TARGETPATH
else
echo "Its about to terminate"
fi
done
The Error is the following
poojasaxena@poojasaxena-laptop:~/Desktop/CMS/script/DataMCMatch$ ./Script4CondorJobs.sh DataMC.sh temp.sh
Thu Aug 16 23:12:44 IST 2012
./Script4CondorJobs.sh: line 20: syntax error near unexpected token `then'
./Script4CondorJobs.sh: line 20: ` then'