Closed cilki closed 2 years ago
I came across this kind of assignment in a legacy codebase:
# Has the same effect as: wrapped='a b c' wrapped=\ "a "\ "b "\ "c"
which shfmt turns into:
shfmt
wrapped="a "\ "b "\ "c"
and causes the runtime error: line 4: b : command not found.
line 4: b : command not found
Tested on GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu) and the latest shfmt.
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
Thanks, this does sound like a bug, probably in the printer. It should be taught to not indent after escaped newlines if that would change the program.
I came across this kind of assignment in a legacy codebase:
which
shfmt
turns into:and causes the runtime error:
line 4: b : command not found
.Tested on
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
and the latestshfmt
.