The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
listing files on remote server vasuarjula AIX 3 06-02-2008 03:23 PM
delete files on a remote server bond_bhai UNIX for Advanced & Expert Users 1 07-27-2007 07:19 AM
FTP multiple files from remote server to local server berlin_germany Shell Programming and Scripting 2 12-20-2006 03:24 AM
copying files to a remote aix server using tar! system-admin AIX 2 11-17-2006 03:30 PM
How to uncompress zip files in a remote server from a script rahul26 Shell Programming and Scripting 2 06-02-2006 02:14 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-13-2007
dineshr85 dineshr85 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 23
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
  #2 (permalink)  
Old 12-13-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
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.
  #3 (permalink)  
Old 12-13-2007
dineshr85 dineshr85 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 23
i dont know the file name

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.
  #4 (permalink)  
Old 12-13-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
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.
  #5 (permalink)  
Old 02-20-2008
ZyxKor ZyxKor is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 1
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:

Quote:
550 *.txt: The filename, directory name, or volume label syntax is incorrect.
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!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:21 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0