Standard AWK variables
code , AWK, code for AWK Tutorials .
The standard AWK variables are discussed below.
ARGC
It implies the number of arguments provided at the command line.
Example
[jerry]$ awk 'BEGIN {print "Arguments =", ARGC}' One Two Three Four
On executing this code, you get the following result −
Output
Arguments = 5
Example
[jerry]$ awk 'BEGIN { for (i = 0; i < ARGC - 1; ++i) { printf "ARGV[%d] = %s\n", i, ARGV[i] } }' one two three four
code , AWK, code for AWK Tutorials .
The standard AWK variables are discussed below.
ARGC
It implies the number of arguments provided at the command line.
Example
[jerry]$ awk 'BEGIN {print "Arguments =", ARGC}' One Two Three Four
On executing this code, you get the following result −
Output
Arguments = 5
Example
[jerry]$ awk 'BEGIN { for (i = 0; i < ARGC - 1; ++i) { printf "ARGV[%d] = %s\n", i, ARGV[i] } }' one two three four
Post a Comment