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 -->
  #2 (permalink)  
Old 05-19-2006
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,789
The problem is that you require ' characters to delimit strings. Here is a workaround not using a here doc:

Code:
userid=me
pswd=mypassword
 command=$(
 echo "$userid/$pswd"
 printf "insert into table1 (a1, a2, a3) values ('%s','%s','%s');\n" $a $b $c
 echo "commit;"
 echo "exit")
 echo "$command" | sqlplus -s