Re: ftp
- From: "Kalyan Manchikanti" <kalyan.manchikanti@xxxxxxxxx>
- Date: 23 Mar 2007 07:41:17 -0700
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
.
- References:
- [shell] ftp
- From: m . impini
- [shell] ftp
- Prev by Date: Re: ftp
- Next by Date: Re: help with ftp script
- Previous by thread: Re: ftp
- Next by thread: Re: [shell] ftp
- Index(es):
Relevant Pages
|