The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sort files by date itik Linux 1 06-02-2008 03:25 PM
Sort all files in a directory retaining originals ledgie UNIX for Dummies Questions & Answers 4 03-19-2008 06:12 AM
Loop through files in dir, omit file with latest date stringzz Shell Programming and Scripting 2 12-04-2007 10:04 AM
Sort files by Date-timestamps available in filename & pick the sortedfiles one by one Chindhu Shell Programming and Scripting 4 08-10-2007 04:54 AM
Loop through files in a directory rladda Shell Programming and Scripting 4 06-24-2005 02:30 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-30-2008
Registered User
 

Join Date: Jan 2008
Posts: 8
Stumble this Post!
loop through the directory for files and sort by date and process the first file

hello

i have a requirement where i have a direcotry in which i get files in the format

STOCKS.20080114.dat
STOCKS.20080115.dat
STOCKS.20080117.dat
STOCKS.20080118.dat

i need to loop through the directory and sort by create date descending order and i need to process the first file.

can any body throw some light on it.

appreciate your help

nag
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-30-2008
Registered User
 

Join Date: Jan 2008
Posts: 2
Stumble this Post!
hi,
try this as a first step

#!/bin/ksh

for $f in `ls -lt`
do

done


Regards,
Alan Mehio
UK, London
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0