You are not logged in.

#1 2004-11-12 00:31:42

Paul
Member
Registered: 2004-04-12
Posts: 72

Bash History

I would like to unset the bash history function

set +o history

This does what I want, but is only a temporary measure. Something else enables the history functionality (ie: unset history, call up xterm, history is enabled.)

I've tried putting the above code into .bash_profile , /etc/profile , and .bashrc. Hmmmm....

:?:

Offline

#2 2004-11-12 02:49:31

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: Bash History

When the shell starts up, the history is initialized from the file named by the HISTFILE variable (default `~/.bash_history'). The file named by the value of HISTFILE is truncated, if necessary, to contain no more than the number of lines specified by the value of the HISTFILESIZE variable. When an interactive shell exits, the last $HISTSIZE lines are copied from the history list to the file named by $HISTFILE. If the histappend shell option is set (see section 4.2 Bash Builtin Commands), the lines are appended to the history file, otherwise the history file is overwritten. If HISTFILE is unset, or if the history file is unwritable, the history is not saved. After saving the history, the history file is truncated to contain no more than $HISTFILESIZE lines. If HISTFILESIZE is not set, no truncation is performed.

http://www.faqs.org/docs/bashman/bashre … tml#SEC113

don't know if that helps or not.

you could also compile bash without such support, and install it as an alternate shell maybe (bash-nohist).
http://www.network-theory.co.uk/docs/ba … f_113.html


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2004-11-12 03:00:39

Paul
Member
Registered: 2004-04-12
Posts: 72

Re: Bash History

Thanks cactus,

I read over what you posted, it seems the trick is to unset the HISTFILE (or make it unreadable).

Here are some hacks I have thought of:

set HISTFILE=/dev/null
or
set HISTSIZE=0

I have been using the latter - it works. (but its just a hack, I'm sure there is a better way to go about this)

Thanks again.

Offline

#4 2004-11-12 12:42:03

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Bash History

I use:

$ ln -s /dev/null ~/.bash_history

Offline

Board footer

Powered by FluxBB