sh icon indicating copy to clipboard operation
sh copied to clipboard

Quoted backtick command substitution replacement doesn't unescape quotes

Open Ashymad opened this issue 1 year ago • 1 comments

Before formatting:

$ echo "`echo \"foobar\"`"
foobar

After formatting:

$ echo "$(echo \"foobar\")"
"foobar"

Solution: quotes in a quoted backtick substitution should be unescaped

$ echo "$(echo "foobar")"
foobar

Ashymad avatar Jul 18 '24 13:07 Ashymad

Seems similar to https://github.com/mvdan/sh/issues/1041, thanks for reporting.

mvdan avatar Jul 18 '24 15:07 mvdan