|
Home > Archive > Unix Shell > December 2007 > FTP commands
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| BeeRich 2007-11-23, 7:20 pm |
| 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.
| |
| --==[ bman ]==-- 2007-11-23, 7:20 pm |
| On Nov 23, 6:20 pm, BeeRich <beer...@gmail.com> 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 <<eof
user <user>
password <passwd>
cd /subdirectory
delete <file>
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.
| |
| BeeRich 2007-11-23, 7:20 pm |
| On Nov 23, 7:02 pm, "--==[ bman ]==--" <bmyn...@gmail.com> wrote:
> On Nov 23, 6:20 pm, BeeRich <beer...@gmail.com> wrote:> Hi folks.
>
>
>
> ftp ftp.domain.com <<eof
> user <user>
> password <passwd>
> cd /subdirectory
> delete <file>
> quit
> eof
>
> Done.
Hi there. Needed a one line solution, and I found one using an echo
command.
Cheers
| |
| Icarus Sparry 2007-11-24, 1:38 am |
| 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.
| |
| wyhang@gmail.com 2007-11-24, 1:38 am |
| On Nov 24, 8:38 am, BeeRich <beer...@gmail.com> wrote:
> On Nov 23, 7:02 pm, "--==[ bman ]==--" <bmyn...@gmail.com> wrote:
>
>
>
>
>
>
>
>
> 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
| |
| BeeRich 2007-12-08, 7:42 pm |
| echo password | ftp...
that's what worked.
Cheers
On Nov 23, 9:15 pm, Icarus Sparry <use...@icarus.freeuk.com> wrote:
>
> 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.
|
|
|
|
|