command stack in buffer

Michael Welle mwe012008 at gmx.net
Tue Jan 5 13:24:26 UTC 2010


Hi,

vijay shanker <vijay.shad at gmail.com> writes:

> Hi Michael;
>
> Open a shell and invoke 'echo $HISCONTROL'. What is the result?
>
> Result :
> ignoreboth
>
> Type 'export HISTCONTROL=ignoredups' in your shell, then invoke a few
> 'ls' and then 'history'. Does the list show only one ls or several?
>
> Result:
> Only shows one "ls" in the history.
>
> :)
>
> I think this is what i wanted to do; and the problem with these lines
fine ;)

> in
> ~/.bashrc
>
> # don't put duplicate lines in the history. See bash(1) for more options
> # don't overwrite GNU Midnight Commander's setting of `ignorespace'.
> export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
                                               ^
Note that list entries have to be separated by colon, not by comma.


> # ... or force ignoredups and ignorespace
> export HISTCONTROL=ignoreboth
>
> One more thing; after i exported the value as you suggested; my history list
> is as below
>
>    62  ls
>    63  vi
>    64  ls
>    65  history
>
> It is clearly showing two entries for ls; but these line suggests some thing
> else
>
> vijay at vijay-laptop:~$ echo $HISTCONTROL
> ignoredups
> vijay at vijay-laptop:~$
>
> Complex thing to understand
OK, I'd misunderstood your usecase, sorry. Please exchange 'ignoredups'
with 'erasedups', that should do what you want. ignoredups take notice
only of the previous history entry, while erasedups takes notice of the
whole list.

Regards
hmw

-- 
biff4emacsen - A biff-like tool for (X)Emacs
http://www.c0t0d0s0.de/biff4emacsen/biff4emacsen.html
Flood - Your friendly network packet generator
http://www.c0t0d0s0.de/flood/flood.html




More information about the ubuntu-users mailing list