0

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.

1 Answers1

1

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

UXDart
  • 2,500
  • 14
  • 12
  • Correct. Content in single-quotes will not change, whereas double-quotes will allow variable substitution. See: [Difference between single and double quotes in Bash](https://stackoverflow.com/a/6697781/174777) – John Rotenstein Aug 11 '17 at 22:28