command stack in buffer

vijay shanker vijay.shad at gmail.com
Tue Jan 5 13:10:27 UTC 2010


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 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
# ... 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


Regards,
Vijay Shanker Dubey



On Tue, Jan 5, 2010 at 5:42 PM, Michael Welle <mwe012008 at gmx.net> wrote:

> Hi,
>
> Colin Law <clanlaw at googlemail.com> writes:
>
> > 2010/1/5 Michael Welle <mwe012008 at gmx.net>:
> >> Hi,
> >>
> >> vijay shanker <vijay.shad at gmail.com> writes:
> >> [...]
> >>>> Now that you raise the issue I am keen to try this solution from
> >>>> http://blog.macromates.com/2008/working-with-history-in-bash/:
> >>>>
> >>>> add to bashrc
> >>>>
> >>>> export HISTCONTROL=erasedups
> >>>> export HISTCONTROL=1000
> >
> > That should be HISTSIZE=1000, someone mis-read from the link.
> OK, haven't read the blog. If HISTCONTROL is set in the right manner it
> should work. I guess the OP 1) hasn't restart the shell or 2) bashrc
> isn't evaluated or HISTCONTROL is overriden or 3) he expects the history
> file is magically changed or 4) he can't copy and paste ;).
>
> 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
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100105/1c8c8e92/attachment.html>


More information about the ubuntu-users mailing list