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 the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 10-13-2008
otheus's Avatar
otheus otheus is online now Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,891
Actually, Gee-Money is on the ball. If your script is in a particular directory, you don't need find. Just ls. However, his script is unnecessarily complex:

Code:
ls -1t |sed -n '/name.*\.log$/{p;q}'

would do and be a bit quicker. (Normally, ls prints out in columns UNLESS it's printing out to a pipe. The -1 here just emphasizes that.)