-
-
Notifications
You must be signed in to change notification settings - Fork 369
Closed
Description
Example using shfmt:
emily@yuyuko ~> cat test.bash
foo=abc
bar=def
echo foo#bar
echo foo#$bar
echo $foo#bar
echo $foo#$bar
emily@yuyuko ~> bash test.bash
foo#bar
foo#def
abc#bar
abc#def
emily@yuyuko ~> shfmt test.bash
foo=abc
bar=def
echo foo#bar
echo foo#$bar
echo $foo #bar
echo $foo #$bar
emily@yuyuko ~> shfmt test.bash | bash
foo#bar
foo#def
abc
abc
None of these contain comments, but the latter two examples get turned into comments (and this actually came up in practice; see bouk/babelfish#23). I'm not sure if it's just variable substitutions or if there are other circumstances where this incorrect parse happens.
bouk
Metadata
Metadata
Assignees
Labels
No labels