[comp.unix.questions] "!" in KSH prompt

tif@doorstop.austin.ibm.com (Paul Chamberlain) (07/27/90)

Does anyone know the trick to getting an unexpanded "!" in a KSH prompt?

I've tried back-slashing, quoting, and temporary variables.  It doesn't
seem to matter what I do, it expands it to the current command number.  I
like to have my prompt hi-lighted so I embed a "`tputs smso`...`tputs
rmso`" in my PS1 but one of my terminals has a "!" in the necessary escape
sequence.  This has very undesirable results.

It's conceivable that different versions could differ in this respect since
my ksh does not handle the PS1='$(date)' type of thing.  Any ideas???

Paul Chamberlain | I do NOT represent IBM         tif@doorstop, sc30661@ausvm6
512/838-7008     | ...!cs.utexas.edu!ibmaus!auschs!doorstop.austin.ibm.com!tif

jrw@mtune.ATT.COM (Jim Webb) (07/28/90)

In article <2940@awdprime.UUCP>, tif@doorstop.austin.ibm.com (Paul Chamberlain) writes:
> Does anyone know the trick to getting an unexpanded "!" in a KSH prompt?

!! does the trick.

I thought it was obvious :-)

-- 
Jim Webb                "Out of Phase -- Get Help"               att!mtune!jrw
                  "I'm bored with this....Let's Dance!"

pbm@hpfcdc.HP.COM (Peter McLain) (07/30/90)

  To get the single character '!' in your ksh prompt, use "!!".


Peter McLain                                          Hewlett-Packard
                                                      3404 East Harmony Road
pbm%hpfclg@hplabs.HP.COM                              Fort Collins
UUCP: hplabs!hpfcla!pbm                               CO          80525-9599