[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wput: bug-report



Am Dienstag, 21. Dezember 2004 00:49 schrieben Sie:
> This is a feature request.
> I would like to be able to have wput take standard input from a pipe and
> successfully complete the transaction.  Currently, if I invoke it as: wput
> -I"dd if=somefile bs=1m |" ftp://server/path, it just complains. Would it
> be hard to make it work like:
> dd if=somefile | wput - ftp://server
> ?
Actually this is possible ;) although a bit tricky.

tar cz dir/ | wput ftp://server/backup.tgz -I "cat -; echo > /dev/null"

So you can use cat as the input-pipe which will read from stdin and pass to 
wput. The echo > /dev/null is because the command is invoked as
"$cmd ftp user host port directory file"
and its output will be read, but since you don't want cat to get these 
additional arguments, they are passed to echo and to /dev/null afterwards.

So for your case the following should work:
wput -I "dd if=somefile bs=1m; echo > /dev/null" ftp://server/path/file
Do not forget to tell wput to which file you want to upload...

-- 
Mit besten Grüßen
 Hagen                          mailto:itooktheredpill@gmx.de
                      http://itooktheredpill.dyndns.org