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:9033 | -Ray, March 15, 2010
More Programming articles...

Buy Abstract Art Canvas Prints

coding headlines

Tutorial: Create an NFS-like Storage Server with GlusterFS on Ubuntu 12.10

Develop your own Raspberry Pi OS

Unix: Shell Script Wrapper Examples

Introduction to Perl one-liners

Using Git for Source Control

bash scripting: Looping through a list

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

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