I have simple script to prepare file and it is working as intended. All code is executed at docker image alpine:latest (so ash busybox)
echo "credentials \"url.com\" {token = \"${VALUE}\"}" > ~/.terraformrc
Later I want to prepare test and I am using if [[ ]] syntax for that.
if [[ $(cat ~/.terraformrc) != "credentials \"url.com\" {token =\"VALUE\" }" ]]; then exit 1; fi
On Bash test is working but on ash/busybox/alpine I get
sh: "url.com": unknown operand
Also on ash/busybox/alpine when I do echo all is escaping correctly
echo "credentials \"url.com\" {token = \"VALUE\" }"
credentials "url.com" {token = "VALUE" }
How should I escape " inside [ ] or [[ ]] ? Thx for help