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 -->
  #3 (permalink)  
Old 11-15-2002
prkwan prkwan is offline
Registered User
  
 

Join Date: Nov 2002
Location: London UK
Posts: 5
I can get the script working as follows:

#!/bin/sh
for name in `ls *.rtf`
do
name1=` echo $name| cut -f 1 -d . `
mv $name1.rtf $name1.doc
done

is working fine, but how do I make it work like this:

chext 1 2

where 1 is the original extension and 2 is the desire new extension?