problem with mv command

I have files with names xxxxxx.04012007.xxxxx in a directotry. I want to move all of the above files to a different date and i am using the command

mv *.04012007.* *.04022007.*

But it's throwing me out error
namely mv: *.04022007.* not found

Can somebody suggest how i can mv all of these files to a different file with same names but different date.

dsravan,
Here is one way to do:

for mOldName in *04012007*
do
  mNewName=`echo $mOldName | sed 's/04012007/04022007/g'`
  echo "mOldName = "$mOldName" nNewName = "$mNewName
  mv $mOldName $mNewName
done

Shell,

Ifi don't want to move but want to copy to another direcotry below the current direcotry How should the script be modifed. Please let me know.

mNewDir='Your_New_Directory'
for mOldName in *04012007*
do
  mNewName=${mNewDir}`echo $mOldName | sed 's/04012007/04022007/g'`
  echo "mOldName = "$mOldName" nNewName = "$mNewName
  cp $mOldName $mNewName
done

Am NEW to UNIX World and i have been studyin UNIX for about 2 weeks as from my point of view it seem that i ve known most of the commands needed for a start what area of interest should i still look...

Ananias,
If you are addressing a new issue, please use a new thread.
In any event, if you want to learn, I recommend you to read
the posts here.
Try to solve the problems without seeing the solution, then
compare your results with other results.

ok man i will do that

Thaks Shell life. It worked fine. Kudos :slight_smile: