Combining awk with other programs


This is a list of awk programs that rely on other unix programs for some part of their functionality. Some may be interesting, others are trivial, but hopefully one will be able to help someone.

Print a list of files in the current directory that are all in caps.
$ ls -1 | awk 'toupper($0)==$0'
The '-1' (note that this is a one, not a lowercase 'L') flag prints 1 file per line, then the awk program only prints it if it is all in uppercase.


Choose your way out: [sed2awk project] [awklores home]

Copyright James Lyons - 2007 - No reproduction without permission
dsplabslinux blogtravel blogcryptographymy homepage