[Bug 46441] sh(1): Does not support PS1, PS2, PS4 parameter expansion
[email protected] Fri, 07 Nov 2025 22:41:41 +0000
| Newsgroups | gmane.os.freebsd.devel.standards |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=46441 --- Comment #24 from [email protected] --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f9e79facf874567f25147b24863e5198164e8d04 commit f9e79facf874567f25147b24863e5198164e8d04 Author: Matthew Phillips <[email protected]> AuthorDate: 2025-10-12 19:27:34 +0000 Commit: Jilles Tjoelker <[email protected]> CommitDate: 2025-11-07 22:35:18 +0000 sh: Implement simple parameter expansion in PS1 and PS2 This change follows a localized approach within getprompt() and avoids full parser reentry. While this means we don't support advanced expansions like ${parameter#pattern}, it provides POSIX-compliant basic parameter expansion without the complexity of making the parser reentrant. This is sufficient for the vast majority of use cases. PR: 46441 bin/sh/parser.c | 126 +++++++++++++++++++++++++++++++- bin/sh/tests/parser/Makefile | 6 ++ bin/sh/tests/parser/ps1-expand1.0 (new) | 7 ++ bin/sh/tests/parser/ps1-expand2.0 (new) | 7 ++ bin/sh/tests/parser/ps1-expand3.0 (new) | 8 ++ bin/sh/tests/parser/ps1-expand4.0 (new) | 8 ++ bin/sh/tests/parser/ps1-expand5.0 (new) | 8 ++ bin/sh/tests/parser/ps2-expand1.0 (new) | 12 +++ 8 files changed, 181 insertions(+), 1 deletion(-) -- You are receiving this mail because: You are on the CC list for the bug.