ftp doesn't know about CI-vars, but the CI does, so the trick is to
build an input file first, and then use that file as $stdin, either by
'<' or by the ;STDIN= run-parm. Here's a script that ftp-puts one file,
could be easily changed to get (it should work to pass the BUILD-parms
in the rname, I think. At least if defined as 'anyparm').
-----------------------------------------
:help ftpput
USER DEFINED COMMAND FILE: FTPPUT.PUB.COMMANDS
parm host="!HPSYSNAME"
fil="@",user="!hpuser.!HPACCOUNT",pasw="",rname="!fil"
#
# Created 19971210, Per Östberg, [log in to unmask]
#
if "!fil" = "@"
echo 'Usage: ftptrans [host],[file],[user],[password],[rname] '
echo 'Transfers a file via ftp: '
echo ' [host] - remote host (default:kemd09) '
echo ' [file] - local filename (no default) '
echo ' [user] - remote username(default:!hpuser.!hpaccount)'
echo ' [password] - remote password(default:empty) '
echo ' [rname] - remote filename(default:same as file) '
return
endif
echo ExitOnError >ftpin
echo open !host >>ftpin
echo user !user !pasw >>ftpin
echo put !fil !rname >>ftpin
echo quit >>ftpin
build ftplist
continue
run ftp.arpa.sys;stdin=ftpin;stdlist=ftplist
if !FTPLastErr <> 0
echo Error from FTP: !FTPLastErr
echo Ftp-output in file: FTPLIST.!hpgroup
return
else
purge ftplist
purge ftpin,temp
endif
-----------------------------------------
hth
/per (kul att se att det finns fler svenska MPE-installationer ;-)
--------------------------------------------
Per Ostberg / [log in to unmask]
phone +46-8-58581213 / fax +46-8-58587710
Huddinge University Hospital
ChemLab / C1 74 / S-141 86 HUDDINGE / SWEDEN
--------------------------------------------
> Hi everybody!
>
> Is it possible to use vaiables in "get" FTP? My try makes no one happy
...
>
>
> :SHOWVAR zFIL@
> ZFILDAT = SM06502I.DAT
> ZFIL = SM06502I
> :FTP
>
>
> File Transfer Protocol [A0008E27] (C) Hewlett-Packard Co. 1990
> ftp> Open SKA
> 220 ska12.data.skanska.se FTP Server (Version 5.0) Ready.
> Connected to x.x.x (xxx.xxx.x.x). (FTPINFO 40)
> ftp> User XXXXX
> 331 Username XXXX requires a Password
> Password:
> 230 User logged in.
> Remote system type is VMS.
> ftp> ASCII
> 200 TYPE set to ASCII.
> ftp> Get !zFILDAT !zFIL;REC=-150,,F,ASCII;DEV=DISC;DISC=1000
> Data Transfer Request Failed. (FTPERR 13)
> ftp> Close
> 221 Goodbye.
> ftp> Exit
>
>
>
> IBM = I Buy Macintoch
>
|