The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-05-2008
bradtri2 bradtri2 is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 4
How to ignore * (asterisk) in a variable

I am using a shell script to read SQL statements stored in a DB2 table and write them out to a file. The problem I have is that some SQL statements have an "*" in them which gets resolved as the list of files in the current directory when I run the script. How can I prevent the "*" from being resolved??

Actual SQL: SELECT * FROM RTDS.TSPSTOPS

Result SQL: SELECT gen.out gen.sql gen2.sql getsql.sh getsql2.sh sqlrow.out sqltxt.out test.sh FROM RTDS.TSPSTOPS

Code Snippet:

sqlrow=$(db2 +c -x fetch from c1 )
fetchrc=$?
echo fetchrc = $rc

echo ${sqlrow}