Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

falis when a here-document delimiter contains a variable or subshell #89

Open
treinen opened this issue Mar 25, 2019 · 1 comment
Open

Comments

@treinen
Copy link
Contributor

treinen commented Mar 25, 2019

Morbig fails with "Failure: Unsupported expansion in here document delimiter" on the following
script

cat << $x
kgjlkfdjgkdflkg
$x

bash accepts it both with with and without --posix, and dash gives an error.

I think that the behaviour of bash is correct since nothing in the standard says that the delimiter word may not contain variables, subshells, or globs. However these are not subject to expansion, as stated in 2.7.4.

@yurug yurug closed this as completed in 38810d5 Mar 27, 2019
@treinen treinen reopened this Apr 1, 2019
@treinen
Copy link
Contributor Author

treinen commented Apr 1, 2019

this is fixed for a delimiter containing a variable, but it still fails when the delimiter contains a subshell

cat <<$(something)
abc
$(something)

this is refused by dash, but accepted by bash --posix. I think that dash is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant