HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ftp script
Operating System - HP-UX
1833738
Members
2498
Online
110063
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
Forums
Discussions
Discussions
Discussions
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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-11-2001 08:52 AM
03-11-2001 08:52 AM
ftp script
Hi,
I am trying to pass multiple file names to "newer" commnad within ftp script. I can write listing of remote dir. using "nlist" command to local file ...
ftp -i -n -v << End_of_ftp
user ....
cd ...
nlist . filelist
newer "| `cat filelist`"
bye
End_of_ftp
this doesn't work - thanks in advance
I am trying to pass multiple file names to "newer" commnad within ftp script. I can write listing of remote dir. using "nlist" command to local file ...
ftp -i -n -v << End_of_ftp
user ....
cd ...
nlist . filelist
newer "| `cat filelist`"
bye
End_of_ftp
this doesn't work - thanks in advance
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2001 03:58 PM
03-11-2001 03:58 PM
Re: ftp script
Hi:
See if this "two-step" script gives you what you want:
#!/usr/bin/sh
#
ftp -i -v -n << EOF
open remotehost
user uuu ppp
cd /tmp/mydir
nlist . /tmp/mylist
bye
EOF
#
while read X
do
ftp -i -v -n << EOF
open remotehost
user uuu ppp
cd /tmp/mydir
newer $X
bye
EOF
done < /tmp/mylist
#
#.end
This should work OK for UNIX-to-UNIX, but will not work if the remotehost is an NT platform. See this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x197d37f45ef7d4118fef0090279cd0f9,00.html
...JRF...
See if this "two-step" script gives you what you want:
#!/usr/bin/sh
#
ftp -i -v -n << EOF
open remotehost
user uuu ppp
cd /tmp/mydir
nlist . /tmp/mylist
bye
EOF
#
while read X
do
ftp -i -v -n << EOF
open remotehost
user uuu ppp
cd /tmp/mydir
newer $X
bye
EOF
done < /tmp/mylist
#
#.end
This should work OK for UNIX-to-UNIX, but will not work if the remotehost is an NT platform. See this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x197d37f45ef7d4118fef0090279cd0f9,00.html
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2001 12:05 PM
03-12-2001 12:05 PM
Re: ftp script
I think you have to look at the logic of what is occurring in your script.
While
D=`ls`
works within a script what happens if you did the same command at the ftp prompt? You would get an error.
JRF is correct that this is a two step process. NOTE his script example will make a new FTP connection for each file in the list.
If your stuck, try debugging via command line imitation of your script. You will be able to find errors very quickly this way!
Regards,
Shannon
While
D=`ls`
works within a script what happens if you did the same command at the ftp prompt? You would get an error.
JRF is correct that this is a two step process. NOTE his script example will make a new FTP connection for each file in the list.
If your stuck, try debugging via command line imitation of your script. You will be able to find errors very quickly this way!
Regards,
Shannon
Microsoft. When do you want a virus today?
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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP