- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: FTP and rename
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
Forums
Discussions
Discussions
Discussions
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
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
04-17-2001 01:23 PM
04-17-2001 01:23 PM
FTP and rename
I have tried doing rename *.txt *.old , all I get is no file or directory..
If anyone knows how I can get around this please let me know.
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2001 01:39 PM
04-17-2001 01:39 PM
Re: FTP and rename
cd /where/the/files/are
find *.txt | while read file
do
pre=`echo ${file} | cut -f 1 -d "."`
mv ${file} ${pre}.old
done
Hope this help....There are a million ways to skin a cat!!!!!
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2001 02:05 PM
04-17-2001 02:05 PM
Re: FTP and rename
do
mv ${FILE} ${FILE%txt}old
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2001 02:41 PM
04-17-2001 02:41 PM
Re: FTP and rename
ll *.txt|awk '{print $9}'>file
while read file
do
mv ${file} ${file}.old
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2001 01:01 AM
04-18-2001 01:01 AM
Re: FTP and rename
for xx in *.txt
do
mv $xx ${xx%txt}old
done
Federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2001 04:04 AM
04-18-2001 04:04 AM
Re: FTP and rename
>/usr/bin/sh
back=`pwd`
cd /location/of/files
for I in *.txt ; do
mv $I $I.old
cd $back
done
I think though you are referring to renaming on the FTP server, which is much more complex. First, you have to make a list of the files that you got from the server on the client.
Next you need to use expect, to run a batch rename, or issue a separate ftp command for each file to be renamed, as you can not use shell commands from within FTP!
Cheasy example.....
#/usr/bin/sh
cd /location/of/files
for I in *.txt ; do
eval while ! EOF ; do
ftp host
user
password
cd /destination
ren $I $I.old
bye
<
done
Dont know if this works or not (PROBABLY NOT) but I think it gives you the concept anyway. Too much perl/CGI lately to think of shell scripting very clearly! :)
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2001 06:54 AM
04-18-2001 06:54 AM