On Wed, Sep 09, 2020 at 11:29:01AM -0700, L A Walsh wrote:
> On 9/8/2020 5:11 AM, Greg Wooledge wrote:
> > On Sun, Sep 06, 2020 at 01:18:22PM -0700, L A Walsh wrote:
> > > > as it's pure & directly viable in PS1 env. var.
> > > > PS1=`echo \!`
> > > ---
> > > Doesn't work if you don't have '!' support (I generally found
> > > '!' more often did unwanted things, but I never used csh):
> > 
> > You're talking abuot csh-style history expansion (set -o histexpand),
> > right?  That has nothing to do with the expansion of \! within PS1.
> > 
> > I've got histexpand disabled, and PS1='\! ' gives the number just fine.
> Like this?
> # t='\! '
> # echo $t
> \!
> ---
> As I said, doesn't work if you don't have '!' support.

No.  I said PS1='\! ' and that's what I meant.  Not some other random
variable.

unicorn:~$ PS1='\! '
502 echo hi
hi
503 

Reply via email to