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 15334
- From: Sebastian Stark <seb@xxxxxxxxxxx>
- To: Eric Smith <es@xxxxxxxxxxxx>
- Subject: Re: do not write certain commands to history file
- Date: Thu, 26 Aug 2010 10:10:35 +0200
- Cc: zsh-users@xxxxxxx
- 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>
Am 25.08.2010 um 21:26 schrieb Eric Smith:
> 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)?
What I do is two things: For commands that I never want to see in my history I make an alias for it that begins with a space character, like so:
alias mkpwlink=' mkpwlink'
If the shell option histignorespace is set, the mkpwlink command will not appear in the history.
If I want to run a whole "session" of commands without history, I use the history stack:
HISTSTACK=0
alias histpush="fc -p && ((HISTSTACK += 1))"
alias histpop="fc -P && ((HISTSTACK -= 1))"
I use the $HISTSTACK variable in my prompt to keep track of my history level.
Sebastian
Messages sorted by:
Reverse Date,
Date,
Thread,
Author