Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Preventing a single command from being saved in history
- X-seq: zsh-users 13867
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Allan Caffee <allan.caffee@xxxxxxxxx>
- Subject: Re: Preventing a single command from being saved in history
- Date: Wed, 18 Feb 2009 17:25:51 +0100
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=1kR94Ilq8pyH08qmSfrGAhIZWwlPckIGHCCCFH933k8=; b=pQqpnhH4nxEG3DD30flA5nF898hcuMt8MkzB5wYMyDaG9GPhSFk/9EVRLGsL+RJci/ mSUHL/VbDYrMJGIL6+znLwWWfJtwLILzNY8DfG4CHLOczmswok0yMtQYO3iLHY2Fvr6O z7aJ0rhzRNKhN4oqto5oN23JnVKwnWXCI3mZo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=VgvozpTv2iV/MOX2zzsgltGDPm4Z6blbQNwkLlEIvJk12VfjqmS9fV4jjvcGyf/yHS ylbAS0eoSujY6XBHBqk/ZwUYqGnO3eyeS5QeIG7TxiaPZeKDemALPk1JKpz2JO3R19K6 Jq4RFCMGwZy+NzdV5tzdVAjZ479WVJRMff8wk=
- In-reply-to: <b2e43f8f0902180819x4955a281r6ae8700e4dbcc5a6@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <b2e43f8f0902180819x4955a281r6ae8700e4dbcc5a6@xxxxxxxxxxxxxx>
2009/2/18 Allan Caffee <allan.caffee@xxxxxxxxx>:
> 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
Just type a leading space and the command won't be saved. You can
retreive it with up-arrow until another command is run (ie just
pressing enter again won't remove it). You also need to setopt
histignorespace for this to work.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author