here is the content of input file
CREATE TABLE `bla bla bla` (
`allianceSiteId` int(11) DEFAULT NULL,
`trunkGroupsId` int(11) DEFAULT NULL,
`lastModified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `allianceSiteId` (`allianceSiteId`,`trunkGroupsId`)
)
here is the part of the code whihc is inside a while loop reading a file
echo "whole line is : $line1"
if [[ `expr match "$line1" ".*CREATE TABLE.*"` != "0" ]]
then
firstword="$line1"
fi
echo "firstword : $firstword"
lastword=") ENGINE=InnoDB AUTO_INCREMENT=2000 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"
echo "lastword : $lastword"
here is the part of output
firstword : CREATE TABLE `AllianceSiteTrunkGroupTrunkGroupsMap` (
lastword : ) ENGINE=InnoDB AUTO_INCREMENT=2000 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
whole line is : )
expr: syntax error
firstword : )
lastword : ) ENGINE=InnoDB AUTO_INCREMENT=2000 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
my doubt is why am i getting "expr: syntax error"... if the $line1 has ) it should not go inside if statement... what is the solution...