jq icon indicating copy to clipboard operation
jq copied to clipboard

How to output a single backslash on window

Open RadAd opened this issue 4 years ago • 0 comments

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

RadAd avatar Jan 31 '22 23:01 RadAd