Shell script containing cat with a long heredoc hangs and breaks further commands
- Dominant language
- Perl
- Stars
- 3.9k
- Forks
- 213
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
To reproduce, create a test.sh with this content:
```sh
#!/bin/sh
cat << EOF
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 1234567
EOF
```
Running `dash test.sh` outputs the heredoc text, as expected.
Now edit test.sh to make the heredoc text one character longer, and run `dash test.sh` again. This produces no output and hangs. The actual content of the heredoc doesn't seem to matter - any heredoc text with more than 512 characters seems to trigger the bug.
Pressing ^D twice appears to return to the a-Shell shell, but any commands started after this point will *also* hang and produce no ouput. The only solution seems to be force-restarting the app.
Tested with a-Shell 1.16.0.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.