The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 01-30-2008
KevinADC KevinADC is offline
Registered User
 

Join Date: Jan 2008
Posts: 338
another suggestion:

Code:
perl -ne '@t = grep{/^cool/}<>; print $t[-1]; exit' path/to/inputfile
change single quotes to double-quotes if using Windows

Last edited by KevinADC; 01-30-2008 at 05:44 PM.. Reason: had to add "exit"
Reply With Quote