[ale] Keep things from history

The Don Lachlan ale-at-ale.org at unpopularminds.org
Sat May 14 17:51:49 EDT 2011


On Sat, May 14, 2011 at 02:37:08PM -0400, Tim Watts wrote:
> On Sat, 2011-05-14 at 12:08 -0400, The Don Lachlan wrote:
> > On Sat, May 14, 2011 at 11:30:56AM -0400, Chris Fowler wrote:
> > > Interesting thing I found in bash a while back and noticed it again
> > > today.
> > > If you put a space before the command it will not be stored in bash's
> > > history.
> > Correction: Bash can be *told* to do that.
> > If you look at your HISTFILE env variable, you'll find "[ ]*" as one of the

I meant HISTIGNORE. Bah...

> > colon-separated elements. That's why it ignores commands that start with a
> > space and why it won't necessarily work everywhere - it has to be set up.
> > This is mine:
> >   HISTIGNORE="&:ls:cd:[bf]g:[ ]*"
> 
> Seems that on my ubuntu 10.04 system it discards "[ ]*" from history
> without being told -- i.e. no HISTIGNORE env var is set. So presumably
> this is the compiled default. Given that, I guess I'd have to use an
> explicit HISTIGNORE to tell it NOT to discard.

There is also a HISTCONTROL env var where you can set 'ignorespace' to do
the same thing; Ubuntu's default bashrc is setting it (but not exported) and
you'll see it if you run 'set | fgrep HIST'.

Still, this is an optional bash thing that Ubuntu has configured in the
default profile.

-L


More information about the Ale mailing list