suggestion: It would be really nice to have some HISTCONTROL setting system-wide by default. i.e. I really miss at least a HISTCONTROL=ignorespace to be set (system-wide). rationale: at least I made it a habbit to always prefix commands like »reboot«, »poweroff«, … (ymmv) with a space, to have them not end up in the history and unintentionally call them again by sticky fingers of course, everyone is able to set that in one's own ~/.bashrc or even drop some file in /etc/bash/bashrc.d/ by their system provisioning solution, but that might turn out to be very cumbersome to most users. however, I think this would be a really nice addition to system default's /etc/bash/bashrc (already being delivered by app-shells/bash from its $FILESDIR) wrt default user experience. Reproducible: Always
Having at least the 'ignorespace' set would be great since space is customary used for prefixing sensitive commands (e.g. passwords as a part of a command).
It's such a pity that HISTIGNORE does not treat its patterns as extended globs unless the extglob shell option is set. Were it to do so, the issue described by Christian could be dealt with more effectively - and less invasively - by setting something like: HISTIGNORE='*([[:blank:]])@(halt|poweroff|reboot|shutdown|systemctl+([[:blank:]])reboot)?([[:blank:]]*)'
Or, rather: HISTIGNORE='*([[:blank:]])@(halt|poweroff|reboot|shutdown|systemctl+([[:blank:]])@(halt|poweroff|reboot|shutdown))?([[:blank:]]*)' I may try submitting a request for HISTIGNORE to always act as if extglob were enabled for 5.3, even though I generally expect for Ramey to reject anything I suggest.