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 the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-28-2005
rahul123_libra rahul123_libra is offline
Registered User
  
 

Join Date: May 2005
Posts: 46
Use awk

for old_name in `ls -l path_to_dir/*jpg`
do
new_name=`awk -F"-" 'BEGIN { OFS="-"} {$3=toupper($3);print $0}' $old_name`
mv $old_name $new_name
done

Last edited by rahul123_libra; 06-28-2005 at 10:37 AM..