How to send multiline data to curl from a script?

Peter Flynn peter at silmaril.ie
Sat Sep 4 09:51:00 UTC 2021


On 04/09/2021 01:16, Karl Auer wrote:
> On Fri, 2021-09-03 at 18:33 +0200, Bo Berglund wrote:
>> When the processing is done and the user entered items have been
>> extracted I now want to send the data via a call to a php script file
>> on *another* webserver for final handling like storage on a private
>> database etc.
> 
> You could build a curl command line 

I'm not clear why you can't just run something like tr '\012' '\040' to
replace all newlines with spaces, so that you pass one long, long line
to curl. On most server platforms there is no meaningful "line length"
limit to a URI (that is, there is a limit but it's in the thousands or
tens of thousands of bytes).

Peter




More information about the ubuntu-users mailing list