sed question Quick summary

From: Dan Hubbard <dhubbard_at_netpart.com>
Date: Thu, 09 Oct 1997 00:46:32 -0700

The answer for this is seems to be use awk and not sed.

eg:

awk '{print $3}' mush

Thanks



After looking through some resources I cannot find the answer on how to do
this with sed :

I have a sample file with the following in it:

good the bad and ugly

Each time this file gets created it will have a different 3rd word, but the
3rd word is always the one I want to extract.

So, I would like to sed the file and extract just the 3rd word ?

I can only see how to extract lines of information like:

sed -e '/b/!d' mush
returns the whole line ?

BTW: sed and awk are my only options on this one.

TIA

------------
Dan Hubbard
Received on Thu Jul 02 1998 - 21:53:04 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT