You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
<< inside ${…} within a multi-line $(…) is read as a here-document opener, so the substitution never closes #18
import{parse}from"unbash";parse("x=$(echo ${x#<<}\n)\necho after");// errors: ["unterminated command substitution"]// statements: one (the assignment); `echo after` is swallowed into the substitution
The same text parses cleanly when any one of these changes:
Input
Errors
Top-level statements
x=$(echo ${x#<<}\n)\necho after
unterminated command substitution
1
x=$(echo ${x#<<}) (one line)
none
1
x=$(echo ${x#a})\necho after
none
2
x=$(echo "${x#<<}"\n)\necho after (quoted)
none
2
echo ${x#<<} (top level)
none
1
Expected: the same as bash. GNU bash 5.2.21 reads << here as the pattern of a # removal, not a here-document operator. It closes the substitution at ) and runs echo after. We checked by running the input under bash with stub commands.
It looks as if the multi-line command-substitution scan treats the << inside the unquoted ${…} as a here-document opener, and then looks for a delimiter line that never comes.
Thanks for unbash: it reads real CI steps closer to bash than anything else we measured.
Activity
webpro commentedon Oct 30, 2026
🚀 This issue has been resolved in v6.0.2. See Release 6.0.2 for release notes.
webpro commentedon Oct 30, 2026
Thanks for the report and reproduction. Should be fixed now.
Very glad to hear you appreciate unbash!