This is for a single line, not a command. I found the way to make it always prevent history for a single command.
Thanks.
EDIT: Sorry for the poor wording.
Single line - For example, if I type, git push production, I might not want to accidentally execute this single line in the future, because it should only be run occasionally, and it has serious ramifications.
Command - In this example, the command is git. I would want the history to remember git push; git push staging
Single command - meant command as well.
Is this clearer now? Thanks.
bash$ !rsyncor something, and end up running the wrong rsync account. I can see how being able to keep thegit push productioncommand out of your history could be helpful. – Tim Kennedy Oct 25 '11 at 17:05HISTIGNORE="git push production:&"will tell bash to ignore thegit push productioncommand, as well as any duplicate commands (which cleans up history, especially if you run the same tail command or ls command repeatedly) – Tim Kennedy Oct 25 '11 at 17:09:&do? – B Seven Oct 25 '11 at 17:34:. Much like $PATH. The&, when supplied to HISTIGNORE, tells bash not to log history if the command you just ran is identical to the one before it. It's a serial-deduplicator for shell history, I suppose. – Tim Kennedy Oct 25 '11 at 19:47