Date: Mon, 28 Feb 2022 07:31:24 +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-j8nEzV92Ah@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 --- Comment #11 from Nathaniel Barragan <contact@nathanielbarragan.xyz> --- I took a look at the code super fast (not planning on any changes yet), and it seems that command substitution was not added on $PS1/PS2 because the parser relies on PS1 and PS2 not doing command substitution on those variables. From what it seems, the parser would need to be redone to become re-entrant. This is because it has some state stored in static global variables, which are cleared each parse. A possible solution, and one that frankly doesn't sound fun would be to figure out which variables are the ones that hold state local to parsing, and which are really required to be static and global, and move these state-keeping variables to a structure, then pass that structure to each parsing function. -- 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-j8nEzV92Ah>
