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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

argv questions

Status
Not open for further replies.

Mag0007

MIS
Joined
Feb 15, 2005
Messages
829
Location
US
How does one control the ARGV array in awk?

I have the ARGV set up in my script, but when I use pipes I get this problem:

df -k | nawk -f script.awk
nawk: can't open file 2
source line number 10

BEGIN {

printf "A=%d, B=%d\n", A, B
for (i = 0; i < ARGC; i++)
{
printf "\tARGV[%d] = %s\n", i, ARGV
}
}


Any reason for this?



 
And what is the 10th line of script.awk ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Line 10
for (i = 0; i < ARGC; i++)

 
Status
Not open for further replies.

Similar threads

Replies
2
Views
88
  • Locked
  • Question Question
Replies
9
Views
214
Replies
4
Views
176

Part and Inventory Search

Sponsor

Back
Top