Skip to content
Archive of posts filed under the faq category.

Text replacement in context/out of context

An added twist to the usual search/replace problems.

Look for multiple patterns in files

One of the most FAQ of all times.

“In-place” editing of files

Temporary files don't bite, so just use them.

Joining files with awk

Join lines from files based on keys

Awk pitfall: string concatenation

This is a bit of a dark corner of awk. This beast is string concatenation. There is a classical example in the awk FAQ number 28: $ awk 'BEGIN { print 6 " " -22 }' 6-22 Where did the space go? First, " " -22 is evaluated, in numeric context, yielding 0-22 = -22. […]