Adobe
Adobe

Reputation: 13487

Substituting INTO double quotes?

How do I substitute a thing INTO the double quotes:

curl -u "bk322:$passw" https://api.github.com/user/repos -d "{'name':"$title"}"

I can't make it

"{'name':\"$title\"}"

because this way JSON parser doesn't understand what I mean.

Upvotes: 0

Views: 115

Answers (1)

sampson-chen
sampson-chen

Reputation: 47367

I have a feeling that it's the single-quotes that your JSON parser doesn't like.

Try:

curl -u "bk322:$passw" https://api.github.com/user/repos -d "{\"name\":\"$title\"}"

Upvotes: 1

Related Questions