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 -->
  #1 (permalink)  
Old 07-02-2009
tententen tententen is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 17
Count matching filenames in a folder

Hi all,

I have 4 files for example named

abc01012009.txt
abc02012009.txt
abc03012009.txt
abc04012009.txt

in a folder. I would like to firstly backup the latest file available, in this case, the latest date available, abc04012009.txt to its subfolder named backup, and then rename the file to abc.txt, so that leaves me with

abc01012009.txt
abc02012009.txt
abc03012009.txt
abc.txt

then, it will run the commands I will set, and once the commands are completed, it go through the list of files again, and loop my commands, until no more files named abcDDMMYYYY.txt are available.Can someone please help, thank you so much!.

rgds