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?
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?