- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ftp rename multiple files beginning with a lea...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 02:32 AM
тАО05-07-2010 02:32 AM
ftp rename multiple files beginning with a leading .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:13 AM
тАО05-07-2010 03:13 AM
Re: ftp rename multiple files beginning with a leading .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:18 AM
тАО05-07-2010 03:18 AM
Re: ftp rename multiple files beginning with a leading .
Or you can rename with wild card character after coping the files
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:23 AM
тАО05-07-2010 03:23 AM
Re: ftp rename multiple files beginning with a leading .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:27 AM
тАО05-07-2010 03:27 AM
Re: ftp rename multiple files beginning with a leading .
you can use this ... this will do the trick .. but you have to run it from that directory where you have these files
for i in ` find . -name ".*xml" -print `
do
new_name=` echo $i | sed 's_/._/_g' `
mv $i $new_name
done
gudluck
prasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:27 AM
тАО05-07-2010 03:27 AM
Re: ftp rename multiple files beginning with a leading .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:37 AM
тАО05-07-2010 03:37 AM
Re: ftp rename multiple files beginning with a leading .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:39 AM
тАО05-07-2010 03:39 AM
Re: ftp rename multiple files beginning with a leading .
[root@vm1 files]# ls -la
total 36
drwxr-xr-x 2 root root 4096 May 4 11:56 .
drwxrwxrwt 11 root root 4096 May 4 11:43 ..
-rw-r--r-- 1 root root 0 May 4 11:56 .239622018_001368083_4E1_20100506080500000_TP217.xml
-rw-r--r-- 1 root root 0 May 4 11:56 349622018_001368083_4E1_20100506080500000_TP217.xml
-rw-r--r-- 1 root root 0 May 4 11:43 .639622018_001368083_4E1_20100506080500000_TP217.xml
-rwxr-xr-x 1 root root 105 May 4 11:47 x.sh
[root@vm1 files]# ./x.sh
[root@vm1 files]# ls -la
total 36
drwxr-xr-x 2 root root 4096 May 4 11:56 .
drwxrwxrwt 11 root root 4096 May 4 11:43 ..
-rw-r--r-- 1 root root 0 May 4 11:56 239622018_001368083_4E1_20100506080500000_TP217.xml
-rw-r--r-- 1 root root 0 May 4 11:56 349622018_001368083_4E1_20100506080500000_TP217.xml
-rw-r--r-- 1 root root 0 May 4 11:43 639622018_001368083_4E1_20100506080500000_TP217.xml
-rwxr-xr-x 1 root root 105 May 4 11:47 x.sh
[root@vm1 files]# pwd
/tmp/files
[root@vm1 files]# cat x.sh
for i in ` find . -name ".*xml" -print `
do
new_name=` echo $i | sed 's_/._/_g' `
mv $i $new_name
done
[root@vm1 files]#
Gudluck
Prasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:43 AM
тАО05-07-2010 03:43 AM
Re: ftp rename multiple files beginning with a leading .
copy these files to another directory
remove the leading "."
then mput to windows server
once mput completes, remove the copied files
Gudluck
Prasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:43 AM
тАО05-07-2010 03:43 AM
Re: ftp rename multiple files beginning with a leading .
ftp> !/usr/bin/1dotmove
for: Command not found.
do: Command not found.
i: Undefined variable.
i: Undefined variable.
new_name=: Command not found.
new_name: Undefined variable.
ftp> quit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:46 AM
тАО05-07-2010 03:46 AM
Re: ftp rename multiple files beginning with a leading .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 03:56 AM
тАО05-07-2010 03:56 AM
Re: ftp rename multiple files beginning with a leading .
okey ... pls provide the data for these..
what is files name in unix box ?? is it .639622018_001368083_4E1_20100506080500000_TP217.xml or with out dot (.) ??
do you want to add or remove dot ??
when you want to add/remove dot ??
Else can you saher the script with us?
Gudluck
Prasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 04:08 AM
тАО05-07-2010 04:08 AM
Re: ftp rename multiple files beginning with a leading .
The rename must take place on the Windows server after the ftp has been done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 04:22 AM
тАО05-07-2010 04:22 AM
Re: ftp rename multiple files beginning with a leading .
I will suggest to try for perl script... But i am very new in perl .. so can't help you much..
still i try for my level best
:)
Gudluck
Prasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 04:28 AM
тАО05-07-2010 04:28 AM
Re: ftp rename multiple files beginning with a leading .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2010 05:42 AM
тАО05-07-2010 05:42 AM
Re: ftp rename multiple files beginning with a leading .
> with one command [...]
> I need to rename in one go.
Why "with one command"/"in one go"? I can't
think of any rename command (on any OS) which
will rename two files in this way at exactly
the same time.
Assuming that this (unspecified) Windows FTP
server supports a rename operation (Does
it?), then what would be the problem if you
renamed two files in two rename operations
instead of one?
> [...] the routine on the remote server
> grabs the file almost instantly [...]
That would seem to be your real problem.
In many cases, it's easier to leave the file
names unchanged, but put the files into a
different (unwatched) destination directory,
and then, after they've been transfered, move
(rename) them into the desired (watched)
destination directory. But, unless you
rename the whole directory, I see no way to
move/rename multiple files simultaneously.
(But I also don't understand the need to do
so.)