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 -->
  #2 (permalink)  
Old 07-02-2009
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,400
you mean this?
Code:
while : ; do
ls -1rt abc[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].txt > /dev/null
if [ $? -eq 0 ] ;then
lastfile=`ls -1rt abc[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].txt|tail -1`
cp $lastfile backup/
mv $lastfile abc.txt
run your set of commands here
else
exit
fi
done