[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
5.3-alpha: less readable output when set -x
From: |
balducci |
Subject: |
5.3-alpha: less readable output when set -x |
Date: |
Wed, 24 Apr 2024 17:34:18 +0200 |
hello
Apologies if I am missing some blatant point here
I have noticed a difference in behavior of bash-5.2.26 and
bash-5.3-alpha which isn't a problem of correctness, but may be wasn't
intentional(?)
Given the scriptlett:
----8<----
#!/bin/sh
set -x
show () {
cat <<EOF
$1
EOF
return 0
}
show "
1
2
3
"
exit 0
----8<----
for me the output is different for the 2 versions:
bash-5.2.26 : bash-5.3-alpha :
----8<---- ----8<----
##> ./scriptlett.sh ##> ./scriptlett.sh
+ show ' + show $'\n1\n2\n3\n'
1 + cat
2
3 1
' 2
+ cat 3
1 + return 0
2 + exit 0
3 ---->8----
+ return 0
+ exit 0
---->8----
Note the difference in how the argument to the function is
output. In the case of bash-5.3-alpha the syntax of the argument is
correct (ie if I call the show function with $'\n1\n2\n3\n' everything
works as expected), but is less readable (and this is more so if the
argument is a long stretch of lines)
For what I seem to understand, this might be related to:
----8<----
b. Bash does a better job of preserving user-supplied quotes around a word
completion, instead of requoting it.
---->8----
?
Of course, if the "new" behavior is intentional, I guess there will be
good reasons for it and apologize for the noise
Just noticed and thought it was good to report upstream
thanks a lot for your valuable work
ciao
-gabriele
- 5.3-alpha: less readable output when set -x,
balducci <=