bug-bash
[Top][All Lists]
Advanced

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

Re: How get last commnda history line number directly


From: L A Walsh
Subject: Re: How get last commnda history line number directly
Date: Wed, 09 Sep 2020 11:29:01 -0700
User-agent: Thunderbird

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]