curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Reg Input to curl from tar command compressed output

From: Daniel Stenberg via curl-users <>
Date: Mon, 6 Apr 2020 09:38:05 +0200 (CEST)

On Mon, 6 Apr 2020, murugan balraj via curl-users wrote:

> I want to share the output of tar compressed image to curl as an input
> using pipe.
> Commands i tried to pipe :
> 1)tar --create --file=- --directory=/dir1 ./ | gzip > gzipimage.tar.gz
> 2)curl -v -T gzipimage.tar-gz tftp://
> I have tried the following. But unsuccessful.
> tar --create --file=- --directory=/dir1 ./ | gzip > - | curl -v -d
> "@-" -T gzipimage.tar.gz tftp:// > gzipimage.tar.gz
> My intention is to avoid creating the intermediate compressed image (
> gzipimage.tar.gz ) while uploading the compressed file using curl.

Something like this?

  tar --create --file=- --directory=/dir1 ./ | gzip -c |
    curl -T- tftp://

The -T option can read the uploaded file from stdin when '-' is used. But when
so, it has no file name to append to the URL so you better set the full name
in the URL you're uploading to.

  / | Commercial curl support up to 24x7 is available!
                   | Private help, bug fixes, support, ports, new features
Received on 2020-04-06