Shellscript in Unix

Shellscript in Unix

Post by era eriksso » Thu, 25 Mar 1999 04:00:00
 >> echo \223 Open File Transport\223
 >> open
 >> user Thomas Hallo             User Passwort
 >> lcd /home/thomas              lokaler Verzeichniswechsel
 >> cd /ftp/Daten                 Verzeichniswechsel auf ftp-Verbindung
 >> get
 >> bye
 >> open              Neue FTP-Verbindung
 >> user Anna Huhu                User Passwort
 >> lcd /home/thomas              lokaler Verzeichniswechsel
 >> cd ..
 >> put
 >> bye
 >> lrm                 Loeschen der Datei auf lokalem
 >> Verzeichnis/home/thomas

I don't speak German, but this is pretty much a standard thing. I
assume you mean you actually want to run an ftp script in a shell
script. The common mistake is failing to realize that a shell script's
commands are visible to the shell script, not to ftp or the other
commands you start from that script. You want something like

 a) a scriptable ftp such as lftp

 b) man netrc

 c) some ftp:s will actually read stuff from standard input correctly:

ftp <<HERE
user Thomas
pass Hallo
lcd ....

 d) script your normal stupid ftp client with something like expect

You should also read the FAQ, I believe it has a section on this.

Hope this helps,

/* era */

.obBotBait: It shouldn't even matter whether     <>
I am a resident of the state of Washington. <>
 * Sign the European spam petition! <> *