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.