bug-bash
[Top][All Lists]
Advanced

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

Re: PS1 \# doesn't take into account HISTIGNORE and HISTCONTROL


From: Chet Ramey
Subject: Re: PS1 \# doesn't take into account HISTIGNORE and HISTCONTROL
Date: Sun, 5 Jun 2016 22:13:29 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

On 6/2/16 2:43 PM, Carlos Morata wrote:
> Hi,
> 
> I think you misunderstod me.
> I'm really interested in working with relative command history expasions.
> So I need to work with !-$((\#-cmdnumbertarget)), not with !$HISTCMD.
> 
> I figure it out pretty well already but I think this is a bug cause you
> loose all the relative history expansions when you hit HISTCONTROL or
> HISTIGNORE and that doesn't get well with the principle of least surprise.

I'm not sure I understand.  If you turn on options and variables that
affect which commands are saved in the command history and how they are
saved (or affect the history list when they are saved, like erasedups),
it seems reasonable to expect that to affect the history number.

If you want the history list to reflect exactly the commands you enter,
unset HISTCONTROL and HISTIGNORE.  That way you can use something like
"!-3" with more confidence.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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