![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Escaping specific character in awk | brainyoung | Shell Programming and Scripting | 8 | 12-16-2008 11:14 PM |
| problem escaping newline in ksh | JamesByars | Shell Programming and Scripting | 7 | 01-05-2008 05:51 PM |
| Escaping '*' in Bash | rkshukla14 | Shell Programming and Scripting | 7 | 04-04-2007 11:45 PM |
| bash script help: escaping the '*' | mark_nsx | Shell Programming and Scripting | 18 | 10-07-2005 08:20 AM |
| escaping * in korn shell | prekida | Shell Programming and Scripting | 3 | 07-13-2005 05:19 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Escaping the * character in ksh.
Hi All,
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 ? Thanks all for your help again. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|