Rick Cogley's Tech Logr

Short Technical Laser Bursts %%

RC Logr 20190324 091526

Sunday, 24 Mar, 2019

Saw this tweet in which .bash_history was accidentally re-executed using source. D’oh! You can prevent this by making an alias to redirect that to an innocuous function. 😥 Not tested yet but I am pretty sure it would be something like this in your .bashrc:

1
2
3
4
5
6
oh_no_you_dont(){
  echo "Stop. You probably should not do that." >&2
}

alias source ~/.bash_history="oh_no_you_dont"
alias scarycmd --silent --killdrive="oh_no_you_dont"

RC Logr 20190324 091526 - Saw this tweet in which … Rick Cogley
Back to Home Tweet Link