![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pass parameter into script | alfredo | Shell Programming and Scripting | 2 | 04-08-2008 06:40 PM |
| how can i pass parameter with spaces to csh script | umen | Shell Programming and Scripting | 1 | 03-19-2008 08:33 AM |
| Help required to pass the parameter | u263066 | Shell Programming and Scripting | 4 | 08-11-2006 10:56 AM |
| Pass Parameter to Another Script | rvprod | UNIX for Dummies Questions & Answers | 4 | 04-05-2002 09:07 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
Can i pass a parameter(not a file name) as a parameter to a awk program? eg; $awk -f test 1 2 3 here test is the filename...and 1,2,3 are the i/p parameters? thank you:-) |
| Forum Sponsor | ||
|
|
|
||||
|
Parameters passed to AWK are stored in the ARGV array, which has ARGC elements.
Example: suppose foo.awk contains Code:
BEGIN {
for ( i = 0; i < ARGC; i++ )
{
print ARGV[i]
}
}
Code:
awk -f foo.awk 1 2 3 Code:
awk 1 2 3 Peace, ZB http://www.zazzybob.com |