From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28106 invoked by alias); 25 Aug 2010 19:46:13 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15326 Received: (qmail 10741 invoked from network); 25 Aug 2010 19:46:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: <20100825192608.GG11622@trustfood.org> References: <20100825192608.GG11622@trustfood.org> Date: Wed, 25 Aug 2010 21:46:06 +0200 Message-ID: Subject: Re: do not write certain commands to history file From: Mikael Magnusson To: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 On 25 August 2010 21:26, Eric Smith 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