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 gkittelson 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
Feb 15, 2005
829
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
 
Status
Not open for further replies.

Similar threads

  • Locked
  • Question
Replies
9
Views
51
Replies
4
Views
53

Part and Inventory Search

Sponsor

Back
Top