<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>&quot;-d @filename&quot; reads the post from a given file name, and &quot;-d @-&quot; 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">&lt;<a href="mailto:rick.moynihan@gmail.com">rick.moynihan@gmail.com</a>&gt;</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&#39;ll do this.<br>
<br>
R.<br>
<div><div></div><div class="h5"><br>
On 31 March 2011 10:40, Gary Short &lt;<a href="mailto:gary@garyshort.org">gary@garyshort.org</a>&gt; wrote:<br>
&gt; Yeah works here too, if I input a short line. The JSON lines are looong,<br>
&gt; that&#39;s why I thought maybe some buffer issue or something. Anyhoo, that<br>
&gt; didn&#39;t work either, sorry, though it did put the single quote in exactly the<br>
&gt; same place near the end of the line. I&#39;ve messed around with this long<br>
&gt; enough, I&#39;m going to try python now I think. Shame Bash didn&#39;t work as it<br>
&gt; would have been a nice, short, simple solution.<br>
&gt;<br>
&gt; Thanks for your help.<br>
&gt;<br>
&gt; Gary<br>
&gt;<br>
&gt;&gt; -----Original Message-----<br>
&gt;&gt; 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>
&gt;&gt; <a href="mailto:bounces@lists.lug.org.uk">bounces@lists.lug.org.uk</a>] On Behalf Of Robert Ladyman<br>
&gt;&gt; Sent: 31 March 2011 10:33<br>
&gt;&gt; To: Tayside Linux User Group<br>
&gt;&gt; Subject: Re: [dundee] Help with Bash Shell<br>
&gt;&gt;<br>
&gt;&gt; Err...well, it works here (as the old saying goes): I suspect that<br>
&gt;&gt; something<br>
&gt;&gt; in the data is being interpreted as a bash command.<br>
&gt;&gt;<br>
&gt;&gt; Try<br>
&gt;&gt;<br>
&gt;&gt; echo \&#39;$data\&#39;<br>
&gt;&gt;<br>
&gt;&gt; (that&#39;s slash-quote)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; Weird, Bash inserts the single quote near the end of the string. It&#39;s<br>
&gt;&gt; like<br>
&gt;&gt; &gt; $data isn&#39;t all there when the quote is added and then the rest of it<br>
&gt;&gt; &gt; &quot;catches up&quot;. Tried putting in a sleep 1, but that made no difference<br>
&gt;&gt; so I<br>
&gt;&gt; &gt; don&#39;t think it&#39;s a timing issue. Tried saving $data locally first so<br>
&gt;&gt; as to<br>
&gt;&gt; &gt; try and flush any buffer, didn&#39;t work either. Weird. Linux sucks. ;-)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt; -----Original Message-----<br>
&gt;&gt; &gt; &gt; 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>
&gt;&gt; &gt; &gt; <a href="mailto:bounces@lists.lug.org.uk">bounces@lists.lug.org.uk</a>] On Behalf Of &#39;Gary Short&#39;<br>
&gt;&gt; &gt; &gt; Sent: 31 March 2011 09:38<br>
&gt;&gt; &gt; &gt; To: &#39;Tayside Linux User Group&#39;<br>
&gt;&gt; &gt; &gt; Subject: Re: [dundee] Help with Bash Shell<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Thanks Robert,<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; And that nearly works too! :-)<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Echoing &quot;&#39;$data&#39;&quot; (to see what gets sent to couchdb) gives me<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &#39;{&quot;key&quot;:&quot;value&quot; ... }<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Note, no single quote at the end, no idea why Bash doesn&#39;t append<br>
&gt;&gt; it,<br>
&gt;&gt; &gt; &gt; it&#39;s<br>
&gt;&gt; &gt; &gt; there in the code, but of course, without it, Couchdb returns &quot;bad<br>
&gt;&gt; &gt; &gt; JSON&quot;.<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Sigh... may have to break out Python<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Thanks for your help<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Cheers,<br>
&gt;&gt; &gt; &gt; Gary<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; -----Original Message-----<br>
&gt;&gt; &gt; &gt; &gt; 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>
&gt;&gt; &gt; &gt; &gt; <a href="mailto:bounces@lists.lug.org.uk">bounces@lists.lug.org.uk</a>] On Behalf Of Robert Ladyman<br>
&gt;&gt; &gt; &gt; &gt; Sent: 31 March 2011 05:09<br>
&gt;&gt; &gt; &gt; &gt; To: Tayside Linux User Group<br>
&gt;&gt; &gt; &gt; &gt; Subject: Re: [dundee] Help with Bash Shell<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; Whoops - that should be:<br>
&gt;&gt; &gt; &gt; &gt; QUOTED_DATA=&quot;&#39;$data&#39;&quot;<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; although the echo would work<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; &gt; if that fails, use the echo trick above and put the result into<br>
&gt;&gt; a<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; new<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; &gt;  variable<br>
&gt;&gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; &gt; QUOTED_DATA=`echo &quot;&#39;$data&#39;&quot;`<br>
&gt;&gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; &gt; note the back-ticks around the right-hand statement<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; --<br>
&gt;&gt; &gt; &gt; &gt; Robert Ladyman<br>
&gt;&gt; &gt; &gt; &gt; File-Away Limited<br>
&gt;&gt; &gt; &gt; &gt; 3 Ralston Business Centre, Newtyle, Blairgowrie<br>
&gt;&gt; &gt; &gt; &gt; Perthshire  PH12 8TL SCOTLAND<br>
&gt;&gt; &gt; &gt; &gt; Tel: +44 (0) 1828 898 158<br>
&gt;&gt; &gt; &gt; &gt; Mobile: +44 (0) 7732 771 649<br>
&gt;&gt; &gt; &gt; &gt; <a href="http://www.file-away.co.uk" target="_blank">http://www.file-away.co.uk</a><br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; ============================================<br>
&gt;&gt; &gt; &gt; &gt; Registered Office: 32 Church Street, Newtyle, Blairgowrie<br>
&gt;&gt; &gt; &gt; &gt; Perthshire, PH12 8TZ SCOTLAND<br>
&gt;&gt; &gt; &gt; &gt; Registered in Scotland, Company Number SC222086<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; &gt; &gt; dundee GNU/Linux Users Group mailing list<br>
&gt;&gt; &gt; &gt; &gt; <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>
&gt;&gt; &gt; &gt; &gt; <a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
&gt;&gt; &gt; &gt; &gt; Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; &gt; dundee GNU/Linux Users Group mailing list<br>
&gt;&gt; &gt; &gt; <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>
&gt;&gt; &gt; &gt; <a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
&gt;&gt; &gt; &gt; Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; dundee GNU/Linux Users Group mailing list<br>
&gt;&gt; &gt; <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>
&gt;&gt; &gt; <a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
&gt;&gt; &gt; Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Robert Ladyman<br>
&gt;&gt; File-Away Limited<br>
&gt;&gt; 3 Ralston Business Centre, Newtyle, Blairgowrie<br>
&gt;&gt; Perthshire  PH12 8TL SCOTLAND<br>
&gt;&gt; Tel: +44 (0) 1828 898 158<br>
&gt;&gt; Mobile: +44 (0) 7732 771 649<br>
&gt;&gt; <a href="http://www.file-away.co.uk" target="_blank">http://www.file-away.co.uk</a><br>
&gt;&gt;<br>
&gt;&gt; ============================================<br>
&gt;&gt; Registered Office: 32 Church Street, Newtyle, Blairgowrie<br>
&gt;&gt; Perthshire, PH12 8TZ SCOTLAND<br>
&gt;&gt; Registered in Scotland, Company Number SC222086<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; dundee GNU/Linux Users Group mailing list<br>
&gt;&gt; <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>
&gt;&gt; <a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
&gt;&gt; Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
&gt;&gt;<br>
&gt;&gt; !DSPAM:5,4d944af9290372356921523!<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; dundee GNU/Linux Users Group mailing list<br>
&gt; <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>
&gt; <a href="https://mailman.lug.org.uk/mailman/listinfo/dundee" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/dundee</a><br>
&gt; Chat on IRC, #tlug on <a href="http://irc.lug.org.uk" target="_blank">irc.lug.org.uk</a><br>
&gt;<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>