Re: How get last commnda history line number directly
From:
Greg Wooledge
Subject:
Re: How get last commnda history line number directly
Date:
Tue, 1 Sep 2020 08:32:22 -0400
User-agent:
Mutt/1.10.1 (2018-07-13)
On Tue, Sep 01, 2020 at 02:14:33AM -0700, almahdi wrote:
> How to get last commnda history line number purely & directly on bash script
> or prompt ?
>
> as it's pure & directly viable in PS1 env. var.
> PS1=`echo \!`
>
> confusingly bash 'mainstream' itself wasn't found way to do
unicorn:~$ x='\!'; echo "${x@P}"
590
I don't know how you plan to *use* this, though. It sounds like an X-Y
problem to me.