Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Re: useful bash tricks thread


2009/2/9 Rick Welykochy <rick@xxxxxxxxxxxxx>:
> Owen Townend wrote:
>>
>> 2009/2/9 Amos Shapira <amos.shapira@xxxxxxxxx>:
>> [snip]
>>>
>>> And one last thing, related to security - if you type a sensitive
>>> string on the command line and get it into your history, use "history
>>> -d" to delete this line.
>>>
>>
>> There is an easier way around this. Most shells, bash included will
>> exclude a line from the history if you begin it with a space.
>
> My bash doesn't do this. It includes the line in the history :(
>
> but
>
> HISTSIZE=2000
> SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
>
> might have an effect on this behaviour.

Ah, my default bashrc has HISTCONTROL set.

~$ echo $HISTCONTROL
ignoreboth

This sets ignorespace and ignoredups, see the man page for details.

cheers,
Owen.