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 11-21-2007
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
Show us what the output looks like and we can probably come up with something. In the meantime, I'd suggest that you want something like:

Code:
myvariable=`long-sql-command`

Use of awk and cut should be able to split out the data in the columns.

Without one of the redirects (at a guess, you should still redirect STDERR to the log but stop redirecting STDOUT so the calling script can capture it instead).