Re: ftp get to stdout
Ryan Mackay said:
> Sometime near Fri, Jan 23, 2004 at 08:57:43AM -0600, Ian Melnick wrote:
>> Hello all,
>>
>> Is there any way to use the 'standard' ftp in this sort of way?
>>
>> ncftpget -c [options] remote-host remote-file > stdout
>>
>> I want to be able to pipe a download thru dd, but I don't have ncftp
>> installed on the machine I want to do it on (and I also can't get
>> ncftp for it...long story).
>>
>>
>> Thanks!
>
> wget supports ftp, maybe it could help :D
Or else something like this:
[cj@nologic scripts]$ cat ftpout
#!/bin/bash
TMPFILE=/tmp/tempfile
ftp $1 <<ENDIT
get $2 $TMPFILE
quit
ENDIT
cat $TMPFILE
rm $TMPFILE
[cj@nologic scripts]$ cat test
this is a test
BYE!!!
[cj@nologic scripts]$ ./ftpout nologic.org test
this is a test
BYE!!!
[cj@nologic scripts]$
All done with a .netrc file to prevent the need for username and password.
HTH.
/Ciaran.
Reply to: