[dundee] Help with Bash Shell

'Gary Short' gary at garyshort.org
Thu Mar 31 08:45:39 UTC 2011


Thanks Robert,

And that nearly works too! :-)

Echoing "'$data'" (to see what gets sent to couchdb) gives me

'{"key":"value" ... }

Note, no single quote at the end, no idea why Bash doesn't append it, it's
there in the code, but of course, without it, Couchdb returns "bad JSON".

Sigh... may have to break out Python

Thanks for your help

Cheers,
Gary

> -----Original Message-----
> From: dundee-bounces at lists.lug.org.uk [mailto:dundee-
> bounces at lists.lug.org.uk] On Behalf Of Robert Ladyman
> Sent: 31 March 2011 05:09
> To: Tayside Linux User Group
> Subject: Re: [dundee] Help with Bash Shell
> 
> Whoops - that should be:
> QUOTED_DATA="'$data'"
> 
> although the echo would work
> >
> > if that fails, use the echo trick above and put the result into a new
> >  variable
> >
> > QUOTED_DATA=`echo "'$data'"`
> >
> > note the back-ticks around the right-hand statement
> >
> 
> --
> Robert Ladyman
> File-Away Limited
> 3 Ralston Business Centre, Newtyle, Blairgowrie
> Perthshire  PH12 8TL SCOTLAND
> Tel: +44 (0) 1828 898 158
> Mobile: +44 (0) 7732 771 649
> http://www.file-away.co.uk
> 
> ============================================
> Registered Office: 32 Church Street, Newtyle, Blairgowrie
> Perthshire, PH12 8TZ SCOTLAND
> Registered in Scotland, Company Number SC222086
> 
> 
> _______________________________________________
> dundee GNU/Linux Users Group mailing list
> dundee at lists.lug.org.uk  http://dundeelug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/dundee
> Chat on IRC, #tlug on irc.lug.org.uk
> 
> !DSPAM:5,4d94333c204511515039377!





More information about the dundee mailing list