Headlines | Linux | Apps | Coding | BSD | Admin | News
Information for Linux System Administration 

I wrote my first programming e-book: Awk One-Liners Explained


I really love writing about programming and Linux, and I just published my first e-book ever on Awk one-liners.

Awk one-liners are short Awk programs that fit on one line and do one particular task, such as numbering lines, double spacing lines, printing only lines that match a pattern, etc.

Here is an example. The following one-liner prints all users on the Linux system:

awk -F: '{ print $1 }' /etc/passwd

This one-liner works this way. The -F: command line argument specifies that the lines in the /etc/passwd file should be split into fields by the colon character. As we all know, the information in /etc/passwd file is colon separated, so the first field $1 gets set to the username, the second field $2 gets set to the password, the third field $3 gets set to user id, etc. This one-liner prints only the first field which is the username. Simple, isn't it?

In my 50 page long e-book I carefully explain 70 one-liners in similar way.

Here is the table of contents of the e-book:

1. Introduction to Awk One-Liners.
2. Line Spacing.
3. Numbering and Calculations.
4. Text Conversion and Substitution.
5. Selective Printing and Deleting of Certain Lines.
6. String and Array Creation.
Appendix A: Awk Special Variables.
Appendix B: Idiomatic Awk.
 read more | mail this link | score:8829 | -pkrumins, June 24, 2011
More Programming articles...

Abstract Art in Tallahassee

coding headlines

OpenShift Online: a non-developer guide

Develop your own Raspberry Pi OS

Unix: Shell Script Wrapper Examples

String matching in regular expressions

Debugging Shell Scripts

C Programming Tutorials


Firefox sidebar

Site map

Site info

News feed


(to post)


Articles are owned by their authors.   © 2000-2012 Ray Yeargin