[PLUG] Capturing the output of an FTP script

Matt Alexander lowbassman at gmail.com
Thu Mar 3 18:18:59 UTC 2005


On Thu, 3 Mar 2005 11:08:05 -0600, Ryan Schlosser <sloshr at gmail.com> wrote:
> On Thu, 3 Mar 2005 10:00:14 -0700, Matt Alexander <lowbassman at gmail.com > wrote:
> > I have the following in a shell script:
> >
> > /usr/kerberos/bin/ftp -i -n -u <<EOF
> > open ftp.somesite.com 
> > user someuser somepass
> > pass
> > mput somefiles*
> > bye
> > EOF
> >
> > Is there a way to log all the information from the FTP transaction
> > that you would normally see if this was done manually?
> > Thanks,
> > ~M
> 
> I do believe one method to do this is using script.
> 
> SCRIPT(1)
> NAME
>      script - make typescript of terminal session
> DESCRIPTION
>      script makes a typescript of everything printed on your terminal.

Hmmm...  How would I use script within a... script?

For example, the following doesn't work:

#!/bin/bash

script test.out

/usr/kerberos/bin/ftp -i -n -u <<EOF
open ftp.somesite.com
user someuser somepass
pass
mput somefiles*
bye
EOF

exit


It just keeps logging everything and never ends the script.
Thanks,
~M



More information about the PLUG mailing list