[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Command history



On 04/28/2011 02:25 AM, Kamaraju S Kusumanchi wrote:
shawn wilson wrote:

Is there a way to have a command that does not show up in history? Or a
way to pipe a string where the string doesn't show up in history?

Ie, I set some passwords with:
echo "some string and stuff" ¦ sha512sum
(Probably with cut and awk and other such things)

And I'd like a way for my system to not store my password scheme. I'd
prefer something better than editing my history file.

In bash, If I prepend the command with a space character, it does not show
up in the ~/.bash_history file.


This happens if in .bashrc you set the shell variable HISTCONTROL to include the value "ignorespace". See man bash

example:
HISTCONTROL=ignoredups:ignorespace

Vangelis


Reply to: