>>>>> "Kyle" == Kyle  <[email protected]> writes:

Kyle> Hi Folks,

Kyle> I am trying to extract a substring from a string found in a
Kyle> file.

Kyle> The string is: *** End of TF0220 at Thu Jul 2 10:06:51 EST 2009
Kyle> - RC = 0

Simplest way is sed.

sed -n -e 's/^.*End of \([^ ]*\) at .*$/\1/p' filename

The regular expression matches an entire line, and throws away
everything but the bit you want.  I'm assuming that the bit you want
doesn't contain spaces, if it does, you need a different regular
expression. 

--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au           ERTOS within National ICT Australia
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to