cURL / Mailing Lists / curl-users / Single Mail

curl-users

Feature request: Fill fields from *multiple* pipes

From: Stefan Klinger <all-lists_at_stefan-klinger.de>
Date: Fri, 11 Jul 2008 22:20:55 +0200

Hello!

I think the curl CLI is missing a feature to read form data from stdout of a process that's not connected to stdin of curl.

More precisely, you can give form data on the command line

  curl -F 'user=johndoe' ...
  
read it from a file

  curl -F 'data=<datafile' ...
  
or from stdin

  datasource | curl -F 'data=<-' ...

But what I want to do is to read the data from stdin, and ask for the passwd via ssh-askpass. As syntax I'd suggest the '=|' characters, in continuation of '=<' and '=@'. Example:

  datasource | curl -F 'data=<-' -F 'pass=|ssh-askpass' ...
                                         ^^
This command should put the output of the command 'datasource' into the 'data' field, and the output of the command 'ssh-askpass' into the 'pass' field. I think it can be done with the popen(3) system call from <stdio.h>.

What do you think?

Regards,
Stefan

-- 
Stefan Klinger                                      o/klettern
                                                    /\/  bis zum
send plaintext only - max size 32kB - no spam         \   Abfallen
http://stefan-klinger.de
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-07-11