Preventing .bash_history to be excuted inadvertantly


Simon Arame

I stumbled upon the worst line i've ever type:
[[email protected]]> . .bash_history
Should'nt there be some kind of protection for that file not to be confused with .bashrc ?
by chance, i quickly hit Ctrl-C and verify i had not break anything.
Any historical command that points by full path is going to hit when such an auto-completion accident happens.
Maybe just adding a warning:
[[email protected]]> . .bash_history
You enter the re-execution of the bash command history, 
This born again shell history.
Are you sure that this is what you want to do ? [y/N]

The feature request process for linux is going to take years !
I just hope the legal aspect was less complex for committers in the "gnu's not Unix" community.



Running Linux or any other "Real" O/S requires a lot of knowledge and a LOT of responsibility!

There are MANY commands you should never run without knowing what you are doing. "source" or the "." (Both are the same!) command, is only one of them. Type "source --help" for more information.

Check out the "10 Most Dangerous Commands – You Should Never Execute on Linux"! Now you can add one more to the list! ;^)
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online