View Single Post
Old May 17th, 2005, 11:37 AM   #11
mxstein
Newbie
 
Join Date: May 2005
Posts: 1
Rep Power: 0 mxstein is on a distinguished road
same problem

I'm having the same problem and was wondering if you found a fix.

I want to store the output of an awk command into a variable to be used later.

Have file names
first last cuid

awk '{print $2 ; }' names
will list last names

last='awk '{print $2 ; }' names'
will not work

any suggestions? I think I have to do something with the quotes to get the output of the awk to go into the variable last.




Quote:
Originally Posted by keenlearner
definitely i want something like..

var=`awk '{printf "%d".$1}' filename`

but this particular command will not work...
this is the problem i am facing that i am not able to write that particular syntax of awk....

could u pls suggest something more...

Thanx
With Regards
mxstein is offline   Reply With Quote