zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-users@zsh.org
Subject: Re: do not write certain commands to history file
Date: Wed, 25 Aug 2010 21:46:06 +0200	[thread overview]
Message-ID: <AANLkTimkMhrSeX6VpDBbMxO-VdMOr4n-0qsF==xBPjNd@mail.gmail.com> (raw)
In-Reply-To: <20100825192608.GG11622@trustfood.org>

On 25 August 2010 21:26, Eric Smith <es@fruitcom.com> wrote:
> Oh zsh seers,
>
> What is the way to match certain words in commands so that they
> are not written to the history file (but might possibly remain in the
> buffer history which does not worry me much)?
>
> (I saw a thread on history encryption, seems a bit heavy handed).

Remaining in the history buffer and writing to the history file seems
to be linked together. You can however use the zshaddhistory()
function to exclude things based on shellcode.

zshaddhistory() {
  [[ $1 != "display ~/pron/*" ]]
}

I tried using fc -p, print -s, but no way i could think of stopped
writing things to the history file while also keeping it in the local
history buffer.

-- 
Mikael Magnusson


  reply	other threads:[~2010-08-25 19:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-25 19:26 Eric Smith
2010-08-25 19:46 ` Mikael Magnusson [this message]
2010-08-25 20:36   ` Eric Smith
2010-08-25 20:41     ` Mikael Magnusson
2010-08-25 20:55     ` Benjamin R. Haskell
2010-08-25 21:01       ` Mikael Magnusson
2010-08-25 21:11         ` Benjamin R. Haskell
2010-08-25 21:01       ` do not write certain commands to history file - solved Eric Smith
2010-08-26  8:10 ` do not write certain commands to history file Sebastian Stark
2010-08-26  8:28 ` Sebastian Stark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTimkMhrSeX6VpDBbMxO-VdMOr4n-0qsF==xBPjNd@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).