Operating System - HP-UX
1821559
Members
2510
Online
109633
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО03-10-2009 01:53 AM
тАО03-10-2009 01:53 AM
I have a unix server and use ftp client to connect the ftp server that provided from remote server ( only ftp is allowed ) , in remote server there have many .txt and .doc files ( in pairs ) , can advise if I want to have a script to do that if the .doc exists then download the corresponding .txt , for example , if aaa.doc exists in remote server then download aaa.txt, if bbb.doc exists then download bbb.txt and so on , can advise how to do it ? thx
aaa.txt
aaa.doc
bbb.txt
bbb.doc
ccc.txt
ccc.doc
aaa.txt
aaa.doc
bbb.txt
bbb.doc
ccc.txt
ccc.doc
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2009 02:20 AM
тАО03-10-2009 02:20 AM
Solution
Hi Heaman,
This should work for you:
ftp -vin < /tmp/file.list
open SERVER
user USER PASSWD
cd /path_to_files
ls *.doc
bye
EOT
cat /tmp/file.list | grep "\.doc" | awk '{print $NF}' | sed s'/\.doc//' | while read FILE
do
ftp -vin < open SERVER
user USER PASSWD
cd /path_to_files
get ${FILE}.doc
get ${FILE}.txt
bye
EOT
done
This should work for you:
ftp -vin <
open SERVER
user USER PASSWD
cd /path_to_files
ls *.doc
bye
EOT
cat /tmp/file.list | grep "\.doc" | awk '{print $NF}' | sed s'/\.doc//' | while read FILE
do
ftp -vin <
user USER PASSWD
cd /path_to_files
get ${FILE}.doc
get ${FILE}.txt
bye
EOT
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2009 05:01 PM
тАО03-10-2009 05:01 PM
Re: script
10 pt.
Thanks a lot.
Thanks a lot.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP