<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial, helvetica, ariel, sans-serif; font-size: 14px; "><div><span class="Apple-style-span" style="font-family: arial, helvetica, ariel, sans-serif; font-size: 14px; ">for curl </span></div>
<div><span class="Apple-style-span" style="font-family: arial, helvetica, ariel, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">curl –X PUT http://couchdb:port/db </span></span></div>
<div><span class="Apple-style-span" style="font-family: arial, helvetica, ariel, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br>
</span></span></div>"-d @filename" reads the post from a given file name, and "-d @-" reads the <br>post data from stdin! </span><br><br><div>azmodie</div><div><br><div class="gmail_quote">On 31 March 2011 12:26, Rick Moynihan <span dir="ltr"><<a href="mailto:rick.moynihan@gmail.com">rick.moynihan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I suspect you might be surpassing the maximum commandline argument limit.<br>
<br>
You might want to look at piping stdin directly into to curl... I<br>
think it takes a - argument that'll do this.<br>
<br>
R.<br>
<div><div></div><div class="h5"><br>
On 31 March 2011 10:40, Gary Short <<a href="mailto:gary@garyshort.org">gary@garyshort.org</a>> wrote:<br>
> Yeah works here too, if I input a short line. The JSON lines are looong,<br>
> that's why I thought maybe some buffer issue or something. Anyhoo, that<br>
> didn't work either, sorry, though it did put the single quote in exactly the<br>
> same place near the end of the line. I've messed around with this long<br>
> enough, I'm going to try python now I think. Shame Bash didn't work as it<br>
> would have been a nice, short, simple solution.<br>
><br>
> Thanks for your help.<br>
><br>
> Gary<br>
><br>
>> -----Original Message-----<br>
>> From: <a href="mailto:dundee-bounces@lists.lug.org.uk">dundee-bounces@lists.lug.org.uk</a> [mailto:<a href="mailto:dundee-">dundee-</a><br>
>> <a href="mailto:bounces@lists.lug.org.uk">bounces@lists.lug.org.uk</a>] On Behalf Of Robert Ladyman<br>
>> Sent: 31 March 2011 10:33<br>
>> To: Tayside Linux User Group<br>
>> Subject: Re: [dundee] Help with Bash Shell<br>
>><br>
>> Err...well, it works here (as the old saying goes): I suspect that<br>
>> something<br>
>> in the data is being interpreted as a bash command.<br>
>><br>
>> Try<br>
>><br>
>> echo \'$data\'<br>
>><br>
>> (that's slash-quote)<br>
>><br>
>><br>
>><br>
>> > Weird, Bash inserts the single quote near the end of the string. It's<br>
>> like<br>
>> > $data isn't all there when the quote is added and then the rest of it<br>
>> > "catches up". Tried putting in a sleep 1, but that made no difference<br>
>> so I<br>
>> > don't think it's a timing issue. Tried saving $data locally first so<br>
>> as to<br>
>> > try and flush any buffer, didn't work either. Weird. Linux sucks. ;-)<br>
>> ><br>
>> > > -----Original Message-----<br>
>> > > From: <a href="mailto:dundee-bounces@lists.lug.org.uk">dundee-bounces@lists.lug.org.uk</a> [mailto:<a href="mailto:dundee-">dundee-</a><br>
>> > > <a href="mailto:bounces@lists.lug.org.uk">bounces@lists.lug.org.uk</a>] On Behalf Of 'Gary Short'<br>
>> > > Sent: 31 March 2011 09:38<br>
>> > > To: 'Tayside Linux User Group'<br>
>> > > Subject: Re: [dundee] Help with Bash Shell<br>
>> > ><br>
>> > > Thanks Robert,<br>
>> > ><br>
>> > > And that nearly works too! :-)<br>
>> > ><br>
>> > > Echoing "'$data'" (to see what gets sent to couchdb) gives me<br>
>> > ><br>
>> > > '{"key":"value" ... }<br>
>> > ><br>
>> > > Note, no single quote at the end, no idea why Bash doesn't append<br>
>> it,<br>
>> > > it's<br>
>> > > there in the code, but of course, without it, Couchdb returns "bad<br>
>> > > JSON".<br>
>> > ><br>
>> > > Sigh... may have to break out Python<br>
>> > ><br>
>> > > Thanks for your help<br>
>> > ><br>
>> > > Cheers,<br>
>> > > Gary<br>
>> > ><br>
>> > > > -----Original Message-----<br>
>> > > > From: <a href="mailto:dundee-bounces@lists.lug.org.uk">dundee-bounces@lists.lug.org.uk</a> [mailto:<a href="mailto:dundee-">dundee-</a><br>
>> > > > <a href="mailto:bounces@lists.lug.org.uk">bounces@lists.lug.org.uk</a>] On Behalf Of Robert Ladyman<br>
>> > > > Sent: 31 March 2011 05:09<br>
>> > > > To: Tayside Linux User Group<br>
>> > > > Subject: Re: [dundee] Help with Bash Shell<br>
>> > > ><br>
>> > > > Whoops - that should be:<br>
>> > > > QUOTED_DATA="'$data'"<br>
>> > > ><br>
>> > > > although the echo would work<br>
>> > > ><br>
>> > > > > if that fails, use the echo trick above and put the result into<br>
>> a<br>
>> > ><br>
>> > > new<br>
>> > ><br>
>> > > > > variable<br>
>> > > > ><br>
>> > > > > QUOTED_DATA=`echo "'$data'"`<br>
>> > > > ><br>
>> > > > > note the back-ticks around the right-hand statement<br>
>> > > ><br>
>> > > > --<br>
>> > > > Robert Ladyman<br>
>> > > > File-Away Limited<br>
>> > > > 3 Ralston Business Centre, Newtyle, Blairgowrie<br>
>> > > > Perthshire PH12 8TL SCOTLAND<br>
>> > > > Tel: +44 (0) 1828 898 158<br>
>> > > > Mobile: +44 (0) 7732 771 649<br>
>> > > > <a href="http://www.file-away.co.uk" target="_blank">http://www.file-away.co.uk</a><br>
>> > > ><br>
>> > > > ============================================<br>
>> > > > Registered Office: 32 Church Street, Newtyle, Blairgowrie<br>
>> > > > Perthshire, PH12 8TZ SCOTLAND<br>
>> > > > Registered in Scotland, Company Number SC222086<br>
>> > > ><br>
>> > > ><br>
>> > > > _______________________________________________<br>
>> > > > dundee GNU/Linux Users Group mailing list<br>
>> > > > <a href="mailto:dundee@lists.lug.org.uk">dundee@lists.lug.org.uk</a> <a href="http://dundeelug.org.uk" target="_blank">http://dundeelug.org.uk</a><br>
>> > > > <a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
>> > > > Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
>> > ><br>
>> > > _______________________________________________<br>
>> > > dundee GNU/Linux Users Group mailing list<br>
>> > > <a href="mailto:dundee@lists.lug.org.uk">dundee@lists.lug.org.uk</a> <a href="http://dundeelug.org.uk" target="_blank">http://dundeelug.org.uk</a><br>
>> > > <a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
>> > > Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
>> > ><br>
>> > ><br>
>> ><br>
>> > _______________________________________________<br>
>> > dundee GNU/Linux Users Group mailing list<br>
>> > <a href="mailto:dundee@lists.lug.org.uk">dundee@lists.lug.org.uk</a> <a href="http://dundeelug.org.uk" target="_blank">http://dundeelug.org.uk</a><br>
>> > <a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
>> > Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
>> ><br>
>><br>
>> --<br>
>> Robert Ladyman<br>
>> File-Away Limited<br>
>> 3 Ralston Business Centre, Newtyle, Blairgowrie<br>
>> Perthshire PH12 8TL SCOTLAND<br>
>> Tel: +44 (0) 1828 898 158<br>
>> Mobile: +44 (0) 7732 771 649<br>
>> <a href="http://www.file-away.co.uk" target="_blank">http://www.file-away.co.uk</a><br>
>><br>
>> ============================================<br>
>> Registered Office: 32 Church Street, Newtyle, Blairgowrie<br>
>> Perthshire, PH12 8TZ SCOTLAND<br>
>> Registered in Scotland, Company Number SC222086<br>
>><br>
>><br>
>> _______________________________________________<br>
>> dundee GNU/Linux Users Group mailing list<br>
>> <a href="mailto:dundee@lists.lug.org.uk">dundee@lists.lug.org.uk</a> <a href="http://dundeelug.org.uk" target="_blank">http://dundeelug.org.uk</a><br>
>> <a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
>> Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
>><br>
>> !DSPAM:5,4d944af9290372356921523!<br>
><br>
><br>
><br>
> _______________________________________________<br>
> dundee GNU/Linux Users Group mailing list<br>
> <a href="mailto:dundee@lists.lug.org.uk">dundee@lists.lug.org.uk</a> <a href="http://dundeelug.org.uk" target="_blank">http://dundeelug.org.uk</a><br>
> <a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
> Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
><br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Rick Moynihan<br>
<a href="http://twitter.com/RickMoynihan" target="_blank">http://twitter.com/RickMoynihan</a><br>
<a href="http://delicious.com/InkyHarmonics" target="_blank">http://delicious.com/InkyHarmonics</a><br>
<a href="http://sourcesmouth.co.uk/" target="_blank">http://sourcesmouth.co.uk/</a><br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
dundee GNU/Linux Users Group mailing list<br>
<a href="mailto:dundee@lists.lug.org.uk">dundee@lists.lug.org.uk</a> <a href="http://dundeelug.org.uk" target="_blank">http://dundeelug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
</div></div></blockquote></div><br></div>