Using a here-doc with trailing backslashes inside a process substitution in bash

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
This:
cat <<EOF
one
two
three
EOF
Prints:
one
two
three
And this:
cat <<EOF
one \
two \
three
EOF
Prints:
one
two
three
But while this:
cat <(
cat <<EOF
one
two
three
EOF
)
Prints:
one
two
three
This:
cat <(
cat <<EOF
one \
two \
three
EOF
)
Prints:
one two three
What's going on? Why are the newlines disappearing in this situation?
bash escape-characters here-document process-substitution
add a comment |
up vote
1
down vote
favorite
This:
cat <<EOF
one
two
three
EOF
Prints:
one
two
three
And this:
cat <<EOF
one \
two \
three
EOF
Prints:
one
two
three
But while this:
cat <(
cat <<EOF
one
two
three
EOF
)
Prints:
one
two
three
This:
cat <(
cat <<EOF
one \
two \
three
EOF
)
Prints:
one two three
What's going on? Why are the newlines disappearing in this situation?
bash escape-characters here-document process-substitution
1
Similar to What does POSIX require for quoted here documents inside command substitution? (probably the same bug or similar...)
– don_crissti
Nov 19 at 13:13
That has been solved in bash 5.0.
– Isaac
2 days ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
This:
cat <<EOF
one
two
three
EOF
Prints:
one
two
three
And this:
cat <<EOF
one \
two \
three
EOF
Prints:
one
two
three
But while this:
cat <(
cat <<EOF
one
two
three
EOF
)
Prints:
one
two
three
This:
cat <(
cat <<EOF
one \
two \
three
EOF
)
Prints:
one two three
What's going on? Why are the newlines disappearing in this situation?
bash escape-characters here-document process-substitution
This:
cat <<EOF
one
two
three
EOF
Prints:
one
two
three
And this:
cat <<EOF
one \
two \
three
EOF
Prints:
one
two
three
But while this:
cat <(
cat <<EOF
one
two
three
EOF
)
Prints:
one
two
three
This:
cat <(
cat <<EOF
one \
two \
three
EOF
)
Prints:
one two three
What's going on? Why are the newlines disappearing in this situation?
bash escape-characters here-document process-substitution
bash escape-characters here-document process-substitution
asked Nov 19 at 12:46
Tom Anderson
415311
415311
1
Similar to What does POSIX require for quoted here documents inside command substitution? (probably the same bug or similar...)
– don_crissti
Nov 19 at 13:13
That has been solved in bash 5.0.
– Isaac
2 days ago
add a comment |
1
Similar to What does POSIX require for quoted here documents inside command substitution? (probably the same bug or similar...)
– don_crissti
Nov 19 at 13:13
That has been solved in bash 5.0.
– Isaac
2 days ago
1
1
Similar to What does POSIX require for quoted here documents inside command substitution? (probably the same bug or similar...)
– don_crissti
Nov 19 at 13:13
Similar to What does POSIX require for quoted here documents inside command substitution? (probably the same bug or similar...)
– don_crissti
Nov 19 at 13:13
That has been solved in bash 5.0.
– Isaac
2 days ago
That has been solved in bash 5.0.
– Isaac
2 days ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482750%2fusing-a-here-doc-with-trailing-backslashes-inside-a-process-substitution-in-bash%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Similar to What does POSIX require for quoted here documents inside command substitution? (probably the same bug or similar...)
– don_crissti
Nov 19 at 13:13
That has been solved in bash 5.0.
– Isaac
2 days ago