Solved

Linux Shell Scripting:  Place string in curl command inside single quote

Posted on 2013-11-25
1
928 Views
Last Modified: 2013-11-25
This works:
curl -k -u "uiimvuxd@sharklasers.com:password123" -X PUT https://zuhqtr5.couchappy.com/testupdates/_design/time2id/_update/u/ -d '{"hello": "world", "number": 555}' -H "Content-Type: application/json"

Open in new window

But this does NOT work:
zzz='{"hello": "world", "number": 555}'
curl -k -u "uiimvuxd@sharklasers.com:password123" -X PUT https://zuhqtr5.couchappy.com/testupdates/_design/time2id/_update/u/ -d '$zzz' -H "Content-Type: application/json"

Open in new window

How can I get it to preserve the single quotes and still put a string inside the single quotes?
0
Comment
Question by:hankknight
1 Comment
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 39676494
zzz='{"hello": "world", "number": 555}'
curl -k -u "uiimvuxd@sharklasers.com:password123" -X PUT https://zuhqtr5.couchappy.com/testupdates/_design/time2id/_update/u/ -d "$zzz" -H "Content-Type: application/json"
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now