rename files in remote server via ftp

Hi All,

I want to rename set of files in the remote server which iam unable to do . i can rename only one file
at a time . for example
ftp $REMOTESERVER
{
rename $NAME1 $NAME2
} is working

whereas

ftp $REMOTESERVER
{
rename $NAME1*.dat $NAME2*.data
} is not working ... Its checking for the file $NAME1*.dat

any suggestions

Yes, rename one file at a time.

You can't really have a wild card for the target unless you want the rename to replace an existing file.

Also, any expansion of the wildcard would give multiple arguments, and rename can only really deal with two.

i dont know the file name - there will be files named like name 2 , name 34 , name 43564, name 355 so lets say i want to rename the files that start with name can i do it ... or is there any other way to change the extn alone.

You could use ftp to get a directory listing, then once you have that list you can determine how to rename the files.

Remember with UNIX files names there is nothing magic about a file's extension.

I'm dealing with the same issue save for the fact that I only have access to FTP on the remote machine. I'm running a script on a local Unix system and connecting to a FTP server on a windows box. What I need to do is move files from \today\.PDF to \yesterday\.PDF. All the files I'm moving are PDF's and there are other files in today's folder that I will not be moving. I tried using the "rename .pdf \yesterday\" gives the error:

I'm not sure what I can do as I am rather limited. I am currently using mget and mput but that takes a ton of bandwidth with these reports. I don't have access to the windows box nor can I install any scripts/programs on it.

I would appreciate any help. Thanks in advance!