Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
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
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:25 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC