You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Bash 5.2.21, declare -p prints the values of shell variables containing escape sequences using ANSI-C quoted strings. This has changed since Bash 5.0.17, in which declare -p literally writes the control codes. The compiler does not interpret escape sequences when reading in variables. This causes incorrect behavior with Bash 5.2.21. For instance, it interprets IFS=$' \t\n' literally, leading to the shell splitting arguments incorrectly.
The test suite doesn’t catch this since it runs on Ubuntu 20.04 using (presumably) Bash 5.0.17. However, the tests fail on Ubuntu 24.04 using Bash 5.2.21.
I created a PR with a potential fix in the sh-expand repo.
Tested on:
Bash 5.0.17 on Ubuntu 20.04
Bash 5.2.21 on Ubuntu 20.04 & 24.04
The text was updated successfully, but these errors were encountered:
BolunThompson
changed the title
Escape sequences in variables aren’t parsed, causing problems with new Bash versions
Escape sequences in ANSI-C quoted strings aren’t parsed, causing problems with new Bash versions
Nov 6, 2024
It does for the main branch, but, in the future branch, the file in question (env_var_utils.py) has been moved to sh-expand. I just opened another PR in that repo, but I can reopen this PR if there’s a desire to merge it into main.
In Bash 5.2.21,
declare -p
prints the values of shell variables containing escape sequences using ANSI-C quoted strings. This has changed since Bash 5.0.17, in whichdeclare -p
literally writes the control codes. The compiler does not interpret escape sequences when reading in variables. This causes incorrect behavior with Bash 5.2.21. For instance, it interpretsIFS=$' \t\n'
literally, leading to the shell splitting arguments incorrectly.The test suite doesn’t catch this since it runs on Ubuntu 20.04 using (presumably) Bash 5.0.17. However, the tests fail on Ubuntu 24.04 using Bash 5.2.21.
I created a PR with a potential fix in the sh-expand repo.
Tested on:
Bash 5.0.17 on Ubuntu 20.04
Bash 5.2.21 on Ubuntu 20.04 & 24.04
The text was updated successfully, but these errors were encountered: