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

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

Up
vote
Down

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:

Preface.
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.
Index.
 read more | mail this link | score:8747 | -pkrumins, June 24, 2011
More Programming articles...

Buy Art Online with Satisfaction Guaranteed

Selected articles

Linux dominates Windows

Microsoft to push unlicensed users to Linux

Mono-culture and the .NETwork effect

The Network Computer: An opportunity for Linux

Hacker Haiku

No, RMS, Linux is not GNU/Linux

Graffiti Server Download Page

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

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