The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 06-28-2005
bhargav's Avatar
bhargav bhargav is offline
Registered User
 

Join Date: Sep 2004
Location: USA
Posts: 511
Quote:
Originally Posted by matrixmadhan
hi,

you can try this,

as far i had tested it works,
plz let me know if there are any errors or anything to be clarified

-----------------------------------------------------
for i in `ls flat*`
do
echo $i > cls
val=`awk '{print substr($i,length($i)-2,3);}' cls`
mv $i file`expr $val + 0`
done
rm -f cls
exit 0
-----------------------------------------------------

Is it not for i in `ls file*` ??
Reply With Quote