Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Preventing a single command from being saved in history



Is there a way to prevent an arbitrary command line from being stored in
the shell history (for any longer than one command)?  A use of this for
example might be if I were to set a password into the environment or
pass some sensitive information to a program on the command line.

If this functionality does not currently exist how difficult would it be
to provide a precommand modifier?  I know the internals for this kind of
manipulation are already in place for options like HistNoStore and
HistNoFunctions. I've only glanced over the source code but it seems
like all that would be needed is to have should_ignore_line return 1 if
the precommand modifier is in effect.

        Regards,
        Allan

P.S. Yes. I'm well aware of how insecure putting sensitive information
into the environment or on a command line is. Consider your obligation
to warn me hereby fulfilled. :P



Messages sorted by: Reverse Date, Date, Thread, Author