On Thu, 26 Jul 2001, Keyur Shroff wrote:
I tried mv *.txt *.doc but I got message that while moving multiple files last argument must be a directory.
Try the following :
for i in *.txt; do j=`expr "$i" : "(.*).txt"`.doc; mv $i $j; done
If you use bash, this will be easier:
for i in *.txt; do mv $i ${i%.txt}.doc; done
The ${i%.txt} construct returns the value of $i with any trailing .txt stripped from it.
Philip