AWK scripting: What is an AWK and how to use it?
This is our first post on AWK, in this we will see some of the basic stuff of AWK like history, advantages syntax and how it works etc.1. A brief history about AWK2. Advantages and disadvantages of AWK3. AWK syntax4. How AWK works? AWK is a command/tool available in all the Linux/Unix flavors to do text filtering, manipulation etc. This tool is mainly meant for processing text files and reporting. AWK can be treated as a programming language due to it’s capabilities such as Arithmetic operations, Binary operations, conditions, loops, functions etc. AWK is an interpreter language. This tool/programming language was developed in 1977 by Alfred V. Aho, Peter J. Weinberger, Brian W. Kernighan. AWK got it’s name from it’s creates family names. Due to it’s capabilities AWK earned it’s nick name as “Awk the Swiss army knife of the Unix toolkit”. This is true because it can do text processing with ease when compared to other text parsing tools available in Linux/Unix. Below are some advantages and disadvantages of AWK tool which I come across when using it. AWK Advantages Validate data Managing small db files Generating reports Parsing command outputs Parsing log files Can parse more than one file at a time. AWK Disadvantages Many flavors are there: awk, nawk, gawk,mawk, tawk which makes portability issue. Cannot be full-pledge scripting language like PERL, Python and Ruby. Useful only for data processing...
Read More