Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Oct 2025 19:00:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 46441] sh(1): Does not support PS1, PS2, PS4 parameter expansion
Message-ID:  <bug-46441-227-zJVKfOb5eF@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-46441-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=46441

Matthew Phillips <matthew@matthewphillips.info> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matthew@matthewphillips.inf
                   |                            |o

--- Comment #18 from Matthew Phillips <matthew@matthewphillips.info> ---
I've implemented parameter expansion support for PS1/PS2/PS4 prompts.

The patch adds support for:
- Simple variables: $USER, $PWD, $HOSTNAME
- Braced variables: ${USER}, ${HOME}
- Special parameters: $$, $?, $!
- Positional parameters: $0, $1, etc.

Tested via some shell scripts. The tests in tests/ weren't interactive and PS1
requires it. Please advice if some test cases are needed and how to add them.

Note: This implements parameter expansion only. Command substitution $(cmd) is
not yet supported and would require additional work.

Attachment below.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-46441-227-zJVKfOb5eF>