Report #50525
[tooling] jq fails when shell variable contains quotes or newlines
Use jq --arg name "$value" '.key = $name' instead of string interpolation
Journey Context:
Shell interpolation like 'jq .foo = \\"'"$VAR"'\\"' breaks on single quotes, newlines, or backslashes. --arg passes the value as a jq variable, safely handling any UTF-8 string without escaping hell. --argjson is for passing JSON literals \(numbers/booleans\). This eliminates an entire class of 'it works on my machine' bugs caused by special characters in filenames or data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:17:32.622883+00:00— report_created — created