|
From: Daniel J S. <dan...@ie...> - 2007-06-08 07:06:41
|
Petr Mikulik wrote:
>>Good point. On my system it is
>>
>>
>>bash (gnome's default?)
>>----
>> 1000 ls
>> 1001 ls
>> 1002 ls
>> 1003 history
>
>
> On OpenSUSE, the default value in environmental variables is
> HISTCONTROL=ignoreboth
>
> so I would see "ls" once only.
>
> "man bash" => search HISTCONTROL gives several nice options -- some of them
> you are implementing for gnuplot. Have a look.
Oh yeah... The 'ignoreboth' means 'ignorespace:ignoredups'. The ignore space
doesn't seem like anything that special or useful; it would mean developing a
habit of typing space before a command one doesn't want to go on the history
list. Is that worth implementing? The 'ignoredups' will leave out commands
that are the same as last command, not quite what you originally implemented.
However, the 'erasedups' is pretty similar, although I think your code stopped
after the first found duplicate...no difference if one starts from a clean
history stack.
Well, this all works on my bash shell. Is there some more direct way of getting
at these features? Or is gnuplot effectively playing the role that a shell
plays as far as accessing GNU readline? I still kind of like the idea of
keeping the whole history stack and only making it a matter of how one views it
and steps through it. The gnuplot rerun-by-number feature
hist !88
just seems like a time saving item. (If people end up not using it by time of
next release, remove it.) When bash does an 'erasedups' all the numbers are
still contiguous. I don't see the point of numbers if they keep changing and
can't be used in some way.
There's one entry in bash history I find a little comical.
-d offset
Delete the history entry at position offset.
On the surface this sounds worthwhile, but who wants to spend time selectively
deleting entries from an ephemeral history list? "Sorry, can't go out tonight;
got to clean my history list."
Dan
|