The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > 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 06:25 PM
Sort all files in a directory retaining originals ledgie UNIX for Dummies Questions & Answers 4 03-19-2008 10:12 AM
Loop through files in dir, omit file with latest date stringzz Shell Programming and Scripting 2 12-04-2007 02:04 PM
Sort files by Date-timestamps available in filename & pick the sortedfiles one by one Chindhu Shell Programming and Scripting 4 08-10-2007 07:54 AM
Loop through files in a directory rladda Shell Programming and Scripting 4 06-24-2005 05:30 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-30-2008
dsdev_123 dsdev_123 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 26
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
  #2 (permalink)  
Old 01-30-2008
alanmehio alanmehio is offline
Registered User
  
 

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

#!/bin/ksh

for $f in `ls -lt`
do

done


Regards,
Alan Mehio
UK, London
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0