Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm writing a ksh to select the files with criteria, i.e. with today date e.g. 'xxx20030225'., then multiple ftp these files to another host. How can I do that? Anyone know? Thanks a lot!

Two approaches come to mind:
In ksh build up a variable containing all the filenames, then use that with an MPUT command in FTP, e.g:
list=*$(date +%Y%m%d).dat
print "Here's the list:"
for f in ${list}
do
print $f
doneftp -i hostname <<-END
cd wherever
mput ${list}
bye
ENDOr, use a co-process to set the ftp process running as a background resource, letting you have loops etc in ksh in the foreground and just talking to the ftp session when you need to using print -p and read -p. Very basic example (untested, will need more work):
ftp -i hostname |&
for f in xxx*.dat
do
print -p put $f
read -p result
doneprint -p bye
The co-process solution may be overkill here but it can sometimes be a neat technique.

![]() |
Process name on AIX
|
Restore takes long time i...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |