Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing variables into awk

Status
Not open for further replies.

massivr

Technical User
Jun 6, 2007
4
IT
Hi All.
Sorry for this (hope not too much) trivial question.
I'm running awk using awk -f PROGRAM.awk SOURCE.tr but i need to assign, via Konsole, a value to a particular variable A present into my script. How can i do this?!
I know there are other threads similar but i did'nt understood them at all!

thanks in advance!



Massimo

 
In your awk man page have a look at the -v option.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PH, thanks a lot!
your reply was really helpful!....no -v options in awk...bu found it in gawk......!


Thanks!

 
massivr said:
PH, thanks a lot!
your reply was really helpful!....no -v options in awk...bu found it in gawk......!


Thanks!
Code:
awk -f PROGRAM.awk myAWKvar="${mySHELLvar}" SOURCE.tr

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top