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

sed and awk tips

Up
vote
Down

Several quick shortcuts for awk and sed...
One of my long-standing "tricks" for awk is using $NF to print the last field on every line. Since NF represents the number of fields on a line (e.g., 6), $NF represents the value of that last field (e.g., $6). Printing the last field of every line, therefore, might look like this:
 read more | score:9549 | -Ray, March 15, 2010
More Programming articles...

Selected articles

Linux dominates Windows

Space Tyrant: A multiplayer network game for Linux

Space Tyrant: A threaded game server project in C

Closed Source Linux Distribution Launched

The Supreme Court is wrong on Copyright Case

Why software sucks

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search


T-shirt gallery:  I Love Pwnage T-shirts
 

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