jq
jq copied to clipboard
How to output a single backslash on window
I am trying to output a single slash.
Using a single backslash seems be used as an escape code for the next character':
> echo "Hello" | jq ". + \" wor\ld\""
jq: error: Invalid escape at line 1, column 4 (while parsing '"\l"') at <top-level>, line 1:
. + " wor\ld"
jq: 1 compile error
Escaping the backslash outputs two backslashes:
> echo "Hello" | jq ". + \" wor\\ld\""
"Hello wor\\ld"
How can I output just one backslash?
OS: Windows jq-1.6