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

Patch for /usr/src/bin/ksh



Hello,

I recently switched from bash to ksh on some machines and noticed that
my custom prompt PS1 didn't work with the '\$' escape sequence.  I
checked the man page and found:

\$      The default prompt i.e. `# ' if the effective
        UID is 0, otherwise `$ '.  Note: this sequence
        is not yet implemented.

The following patch for lex.c and ksh.1 should implement '\$' now and
remove the note from the man page.

Mainly the problem was that POSIX seems to want '\$' escaped in any
case, so the later prompt function just got an already escaped '$'
and therefore ignored it.

If the patch is fine for you (please test), I would go ahead and also
implement this guy:

\!      The current history number (see `\#', below).
        Note: this sequence is not yet implemented.

Regards,
Marcus

-- 
Marcus Glocker, marcus_(_at_)_nazgul_(_dot_)_ch, http://www.nazgul.ch -----------------

[demime 1.01d removed an attachment of type application/octet-stream which had a name of lex_c.patch]

[demime 1.01d removed an attachment of type application/octet-stream which had a name of ksh_1.patch]