[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $* in here-document
From: |
Chet Ramey |
Subject: |
Re: $* in here-document |
Date: |
Mon, 28 Apr 2025 14:42:23 -0400 |
User-agent: |
Mozilla Thunderbird |
On 4/24/25 11:13 PM, Martijn Dekker wrote:
Reproducer:
IFS=/
set a b c
cat <<EOF
$*
EOF
Actual output: a b c
Expected output: a/b/c
In any context in which field splitting is not possible, POSIX specifies
that $* uses the first character of $IFS as the output field separator.
Here-documents are such a context.
Thanks for the report. I fixed this back in November, 2022, based on
https://lists.gnu.org/archive/html/bug-bash/2022-09/msg00002.html
It came in too late in the bash-5.2 release cycle to be included.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature