The UNIX and Linux Forums  

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




Thread: Help with awk
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-26-2009
mac4rfree mac4rfree is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 168
Help with awk

Hi Guys,,

I am assigning a query result to a variable.

variable=`db2 -x "select col1 from table1 | awk '{print $1}'`

The problem is if i execute the above command without awk. I am getting an value. But if i execute with awk command, i am getting an error, saying
A database connection does not exists.

I want the awk command to be used.

Please help me.

Thanks for your help in advance,
Magesh