Tiny Core Linux
Tiny Core Extensions => TCE Tips & Tricks => Topic started by: netnomad on November 20, 2012, 02:35:09 AM
-
hi friends,
i use extensively the midnight-commander in the bash started in aterm.
unfortunately every single action in the midnight-commander is included in my ~/.bash_history:
.bash_history:
mc
PROMPT_COMMAND='pwd>&8;kill -STOP $$'
cd "`printf "%b" '\0057home\0057tc'`"
cd "`printf "%b" '\0057home\0057tc\0057\0056fluxbox'`"
cd "`printf "%b" '\0057home\0057tc'`"
cd "`printf "%b" '\0057home\0057tc\0057\0056gconf'`"
so the real important commands are hidden or lost in the bash-history :(
what would you recommend to get rid of that "feature"?
thank you for your help.
-
Hi netnomad,
A quick google search turns up this debian bug report (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=529590), specifically:
Here a citate of README.Debian (please read it before filling bugs):
-------------------
- In order to get rid of the commandline history to be full with cd commands
from the both boxes set this environment variable:
export HISTCONTROL=ignoreboth
This is a issue of bash, not of mc. This would fix it.
-------------------
(Note: I didn't test that it actually works)
-
hi althalus,
thanks a lot, it works!
by the way,
could you help me with HISTSIZE, too?
i wasn't able to extend it from 500 to 1000, yet :(
./bashrc
source /usr/local/etc/bashrc
export HISTCONTROL=ignoreboth
export HISTSIZE=1000
thank you for your help.
-
Hi netnomad
Maybe try adding it to .profile?
-
hi rich,
.profile has no effect for this issue,
only the entry in .bashrc has any effect.
by the way,
export HISTCONTROL=ignoredups,erasedups
has no effect, too.
does someone know whether the syntax
export HISTCONTROL=ignoredups,erasedups
or
export HISTCONTROL=ignoredups:erasedups
is the correct entry?
this is the last version of my
.bashrc
source /usr/local/etc/bashrc
export HISTCONTROL=ignoreboth,erasedups
export HISTSIZE=1000
export HISTFILESIZE=1000000
thank you for your contributions.
-
man bash says to use colons, ":".
-
hi rich,
thank you, you are right,
but
.bashrc
source /usr/local/etc/bashrc
export HISTCONTROL=ignoreboth:ignoredups:erasedups
export HISTSIZE=1000
export HISTFILESIZE=1000000
has still no effect on the dups:(
.bash_history
mc
exit
exit
ls
exit
mc
ls
exit
-
export HISTCONTROL=ignoreboth:ignoredups:erasedups
Try this:
HISTCONTROL="ignorespace:erasedups"
No noise from mc, and no dups in my bash history.
The wording for HISTCONTROL suggested to me that cramming all the options together causes some sort of conflict. Testing seems to confirm that my thinking is heading in the right direction.
HISTCONTROL
A colon-separated list of values controlling how commands are saved on the history list. If the list of values includes ignorespace, lines
which begin with a space character are not saved in the history list. A value of ignoredups causes lines matching the previous history
entry to not be saved. A value of ignoreboth is shorthand for ignorespace and ignoredups. A value of erasedups causes all previous lines
matching the current line to be removed from the history list before that line is saved. Any value not in the above list is ignored. If
HISTCONTROL is unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the
value of HISTIGNORE. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardā
less of the value of HISTCONTROL.
-
No noise from mc, and no dups in my bash history.
hi friends,
i didn't succeed with the "no dups" :(
although i checked ~/.ashrc, ~/.bashrc and ~/.profile and tried so many different configurations...
i even changed the /usr/local/etc/bashrc,
but at least the noise is gone :)
thank you for your help.