FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 10-19-2011, 05:20 PM
Adel ESSAFI
 
Default probleme with awk arguments

thx


2011/10/18 Miner, Jonathan W (US SSA) <jonathan.w.miner@baesystems.com>



> From: users-bounces@lists.fedoraproject.org [users-bounces@lists.fedoraproject.org] On Behalf Of Adel ESSAFI


>

> [adel@localhost ~]$ C=g

> [adel@localhost ~]$ awk *-v c=$C '{ print $c }' coran.pls



Drop the dollar sign from the awk print statement...



awk -v C=$C '{print c}' coran.pls



The dollar sign references the FIELD on the input. *So $c will display the c'th field of the line; a more familiar example is NF, or the number of fields. *By itself, NF, prints a number, but $NF prints the last field on the line.


--

users mailing list

users@lists.fedoraproject.org

To unsubscribe or change subscription options:

https://admin.fedoraproject.org/mailman/listinfo/users

Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines



--
PhD candidate in Computer Science
Address* * **
3 avenue lamine, cité ezzahra, Sousse 4000
Tunisia
tel: +216 97 246 706 (+33640302046 jusqu'au 15/6)

fax: +216 71 391 166


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 11:39 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org