Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: do not write certain commands to history file
- X-seq: zsh-users 15326
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: do not write certain commands to history file
- Date: Wed, 25 Aug 2010 21:46:06 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=EtPv+/c8ugthbtmnI7xVHS8yBJ74OFjsMdd6toVX9+0=; b=gDqGX1APMGmjRoUZ1SB64Ywl5kSCb6iIyeOo3awWNuGp8ZOKB+Pgilr9rDpLdeEG6R a1Yv5CjBP8bpsQiVe47cTXoEYgTWggozMssFLw/87zkI/9fm1YKTNRTTMchH1hJg+Ygn CZ4uyA+iVE3nQCPe4HMqq4fwxLMdXz5FvNz78=
- 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 :content-type; b=dpRjgNEDYsZfjx/p0oNnEohs/ZjWk4bYta+xMg9lim8KA+anJXBJz4lp4GmWRga04u DOB7BaE8n9B8Z4JK4PSfN0cOG1P5eYs8OnqTz2ErxwIWQg7dvRvuqH1gGVZQZCHANdCQ Ya/L5scH+87EOuailFH9fcoc/kr9MhtvUyYmg=
- In-reply-to: <20100825192608.GG11622@xxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20100825192608.GG11622@xxxxxxxxxxxxx>
On 25 August 2010 21:26, Eric Smith <es@xxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author