Re: ftp



On Mar 23, 4:18 am, m.imp...@xxxxxxxxx wrote:
hello,
i have a problem with my shell script. I have to connect to a FTP and
execute some commands in it, then I have to return to the shell and
execute other commands.. my problem is that I can't get back to the
normal shell after connecting the FTP

for example:
#! /bin/sh
ftp -nv ftp.domain.com >> EOF
user xxx xxx
bin
pwd
quit
echo "hello world"

the echo "hello world" won't be executed! nor any command following
the "quit" command..
but the rest of the script goes right..

(sorry for my poor english)

If you want to run the command on the local server within the EOF
string..you need to preface it with "!"..But for this you still need
to be within the ftp session as that's what your EOF string is
starting from. Anyway I also noticed that you used your EOF in a wrong
manner ( should be << and not >>)..

the modified script will look like this,

#!/bin/sh

ftp -nv ftp.domain.com << EOF
user xxx xxx
bin
pwd
!echo "hello world"
quit
EOF

.



Relevant Pages

  • Re: variable question
    ... Something I failed to mention was that I may be trying to send up to 100 files in a run, so i dont want to be exiting ftp and restarting it every file... ... on the ftp internal commands to copy and purge cos that works, and I coulnt find any other way to execute local commands inside ftp. ... command and then set CI variables so I know what command failed. ... !setvar remotefile ' ' ...
    (comp.sys.hp.mpe)
  • Multiple-Vendor-FTP-Vuln. (old?)
    ... When a user logged in in ftp and type ... the ls command the in.ftpd takes over 90 percent cpu-usage and execute = ... the command 2 or 3x than the full system hang up. ... Linux Mandrake 8.0 ...
    (Bugtraq)
  • Re: bash script goes too fast
    ... > then put via ftp somedir.tgz to a remote server. ... the command preceding it will be executed in a subshell in the background. ... It will then go on and execute the next command regardless of the first ... For more information have a look at 'man bash'. ...
    (comp.os.linux.setup)
  • How to get output from compound statement in a variable
    ... When i execute the following instruction; ... !EOF ... use the $(command or backticks to execute a command and store the ...
    (comp.unix.shell)
  • Re: ftp "command file" option on unixware
    ... OK and the transfer is working, but I'm getting am ?Invalid command error. ... > philby wrote: ... >> execute the ftp statement that uses it. ...
    (comp.unix.sco.misc)