In ksh script i'm trying to assign "sqlstmt1" varaible value,
update VAREntryTb set VAR10num = VAR1num * Mltplr where BusD = '$val1' and RunI = 1"`
Hence i wrote below statement, the issue with this is shell is expanding "*" character adn thus subistuting it with the content of my present directory,
sqlstmt1=`echo "update VAREntryTb set VAR10num = VAR1num * Mltplr where BusD = '$val1' and RunI = 1"`
when i escape it with "\" like,
sqlstmt1=`echo "update VAREntryTb set VAR10num = VAR1num \* Mltplr where BusD = '$val1' and RunI = 1"`
then everything is fine except backward slash is also coming as part of whole string, something like,
update VAREntryTb set VAR10num = VAR1num \* Mltplr where BusD = '$val1' and RunI = 1
Can someone help me in getting the things right here ?
Thanks all for the your help, both the above solution worked fine.
Even i was wondering why "*" is getting expanded even if put it in double quotes. The problem was with my coding only, as after setting the sqlstmt variable, i was writing it's content to file, like
echo $sqlstmt >> sqlfile.txt, so here lies the problem, as i changed it to echo "$sqlstmt" >> sqlfile.txt. And since i didn't turn off the "-x" flag i didn't got it noticed.
Also can you kindly give me brief discription, as what "set -f /+f " does ?