awk operates on one or more input files. You can specify input files in command line with
1.1 filename, for example:
awk -f script.awk inputfile.txt
1.2 list, for example:
awk -f script.awk file1.txt file2.txt file3.txt
1.3 wildcards
awk -f script.awk *.txt
*.txt means: all files with .txt extension.
You can specify any number of input files on the command line and awk will automatically open and read them. This is an attribute of scripting programming langaugage: awk automates processing command-line arguments - awk will automatically get the filename from the command line, open a file, and read its contents line-by-line. This is really powerful. I think, awk is also a simpler to use alternative to Perl, Python and Tcl.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.