[PLUG] Capturing the output of an FTP script

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


On Thu, 3 Mar 2005 11:18:59 -0700, Matt Alexander <lowbassman at gmail.com> wrote:
> 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.

I copied over a newer version of script that supports the -c option
for running a script, however, it still doesn't log the transaction
between the EOF markers.
Thanks,
~M



More information about the PLUG mailing list