Venkatesh Kandasamy
Venkatesh Kandasamy

Reputation: 79

How to do variable substitution in json

The below table insert command takes a json as an input. I am trying to do variable substitution but it didnt work. What is the right way to do it.

note: echo on numberoflines works.

aws dynamodb put-item     --table-name staging-metrics     --item '{ "count": {"S": $numberoflines} }'

tried alternatives like "$(numberoflines)" but that stores $(numberoflines) literally in table.

Upvotes: 0

Views: 713

Answers (1)

UXDart
UXDart

Reputation: 2620

I'm not sure about this... but isn't --item "{ \"count\": {\"S\": $numberoflines} }"

Upvotes: 1

Related Questions