Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-27-2008
jaduks's Avatar
jaduks jaduks is offline
Registered User
 

Join Date: Aug 2007
Location: India
Posts: 177
If you just want to extract the last field:

Code:
$ sed -n 's/.*\.//;p' gobi.txt
or
$ awk 'BEGIN{FS="."} {print $NF}' gobi.txt

And to extract the digits:


Code:
$ sed 's/.*\.\.\([0-9]*\).*/\1/' gobi.txt

//Jadu