NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/16226 (Prompt expansion for /bin/sh)



Synopsis: Prompt expansion for /bin/sh

Responsible-Changed-From-To: bin-bug-people->kre
Responsible-Changed-By: kre%NetBSD.org@localhost
Responsible-Changed-When: Thu, 25 May 2017 08:06:28 +0000
Responsible-Changed-Why:
I have an almost working prompt expansion (parameter expansion,
plus arithmetic, and (if enabled by an option) command substitution)
which is both what the standard expects, and more flexible than a
few fixed \X characters being expanded...

"almost working" means that it works, 99.9% of the time, but I have
one very rare error mode case (when something goes wrong with the
expansion, and the user needs to ^C to get control back) that sometimes
drives the shell totally insane (though even this usually works fine.)

Once I find what is happening with that one (hard, because it is so
rare, and so far I have not been able to deliberately provoke it into
happening), the suggestion in this PR can be considered obsolete I
think.

I am not planning (as in would actively resist) any attempt to add the
(current) posix specified (or semi-specified) magic ! handling for
PS1 however - if we really need access to history related values,
they should be exported in the form of regular sh variables,
which parameter expansion can then access.  That's clean and
consistent, and well defined, unlike the ! hack.





Home | Main Index | Thread Index | Old Index