FTP commands

FTP commands

am 24.11.2007 00:20:34 von BeeRich

Hi folks.

I'm trying to use a single line to delete a file on a remote ftp
server. I am in the OS X bash shell, and I am trying to integrate a
gateway to the bash shell. I am using ftp commands, and this is the
current syntax I am using, which reports that it is working, but it
isn't deleting the file.

ftp -p -d ftp://username:password@ftp.domain.com/subdirectory/ delete
filename.jpg

It goes to the proper subdirectory, but the delete isn't happening,
nor being asked to be done. I've turned on debugging and passive
mode.

Any ideas? Cheers.

Re: FTP commands

am 24.11.2007 01:02:02 von bmynars

On Nov 23, 6:20 pm, BeeRich wrote:
> Hi folks.
>
> I'm trying to use a single line to delete a file on a remote ftp
> server. I am in the OS X bash shell, and I am trying to integrate a
> gateway to the bash shell. I am using ftp commands, and this is the
> current syntax I am using, which reports that it is working, but it
> isn't deleting the file.
>
> ftp -p -d ftp://username:passw...@ftp.domain.com/subdirectory/ delete
ftp ftp.domain.com < user
password
cd /subdirectory
delete
quit
eof

Done.

> filename.jpg
>
> It goes to the proper subdirectory, but the delete isn't happening,
> nor being asked to be done. I've turned on debugging and passive
> mode.
>
> Any ideas? Cheers.

Re: FTP commands

am 24.11.2007 01:38:01 von BeeRich

On Nov 23, 7:02 pm, "--==[ bman ]==--" wrote:
> On Nov 23, 6:20 pm, BeeRich wrote:> Hi folks.
>
> > I'm trying to use a single line to delete a file on a remote ftp
> > server. I am in the OS X bash shell, and I am trying to integrate a
> > gateway to the bash shell. I am using ftp commands, and this is the
> > current syntax I am using, which reports that it is working, but it
> > isn't deleting the file.
>
> > ftp -p -d ftp://username:passw...@ftp.domain.com/subdirectory/ delete
>
> ftp ftp.domain.com < > user
> password
> cd /subdirectory
> delete
> quit
> eof
>
> Done.

Hi there. Needed a one line solution, and I found one using an echo
command.

Cheers

Re: FTP commands

am 24.11.2007 03:15:10 von Icarus Sparry

On Fri, 23 Nov 2007 15:20:34 -0800, BeeRich wrote:

> Hi folks.
>
> I'm trying to use a single line to delete a file on a remote ftp server.
> I am in the OS X bash shell, and I am trying to integrate a gateway to
> the bash shell. I am using ftp commands, and this is the current syntax
> I am using, which reports that it is working, but it isn't deleting the
> file.
>
> ftp -p -d ftp://username:password@ftp.domain.com/subdirectory/ delete
> filename.jpg
>
> It goes to the proper subdirectory, but the delete isn't happening, nor
> being asked to be done. I've turned on debugging and passive mode.
>
> Any ideas? Cheers.

Try

ftp -p -d -n ftp.domain.com <<'!'
user username password
cd subdirectory
delete filename.jpg
!

(thats 5 lines) and see if that works. This is being done from general
ftp experience, I don't have an OS X machine to try it on, so if someone
else offers you a suggestion then try theirs first.

Re: FTP commands

am 24.11.2007 04:00:16 von wyhang

On Nov 24, 8:38 am, BeeRich wrote:
> On Nov 23, 7:02 pm, "--==[ bman ]==--" wrote:
>
>
>
> > On Nov 23, 6:20 pm, BeeRich wrote:> Hi folks.
>
> > > I'm trying to use a single line to delete a file on a remote ftp
> > > server. I am in the OS X bash shell, and I am trying to integrate a
> > > gateway to the bash shell. I am using ftp commands, and this is the
> > > current syntax I am using, which reports that it is working, but it
> > > isn't deleting the file.
>
> > > ftp -p -d ftp://username:passw...@ftp.domain.com/subdirectory/ delete
>
> > ftp ftp.domain.com < > > user
> > password
> > cd /subdirectory
> > delete
> > quit
> > eof
>
> > Done.
>
> Hi there. Needed a one line solution, and I found one using an echo
> command.
>
> Cheers

how echo work? could u pls paste the code?

for this kind of job, I'm too spoiled by expect:)