From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30369 invoked from network); 25 Jan 2021 16:29:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Jan 2021 16:29:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1611592187; b=J72+0fC0aXl/jwI+iZILOpbUc8BK/RaO8nbvRulBzu1IZViiHPnzgEIRbpnxipGPz6fauFNO6o TI19fyDz5B7AltWc+/1Mss3J3aUwbBTGOIxjKFz+dV7pIKRvf3yD8MJOTZV4gGQD1zGt8vW7E4 K4P+ywBkRkd/yjej+aW3v3XKGHiKzKSgjv+wF6HA5kDAR8IUb+OjanPUA9J5Ti0NjyQsT9xRCO UsWjq1cC8MICYxxaoPazncOn8XQm1wJJjdBvocRX7bu2DU5iR6c+hdjodoBO0aJWFG9Lp96wfK xHG0/iTpWfOzTZ9gyQIorU4CR+ljdRU9Yt3+PbAJZkG0wg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f49.google.com) smtp.remote-ip=209.85.166.49; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1611592187; bh=VwT0gKlY8MUCSY7Tpxfuxzfu4A4wW127mRtfptos2FE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=ZigKv78p0yjo+vaO/rgFW2xu5hVTB8oiK+VZqI70QIxsrWNVJDSwmJ9lQPrPiDBFjgCZExKXtL XBUyhLF5upu0B1UgHSkAJWZHTszkM/uVPE+HDPJMSflwK4yaRS092u9amacdz1TQ2DOXdF0Mb9 aHZEH5sZmqSRem7FGwY1m0TrM1GaDDy+L4K+NjjeuMb1xlKMsmkHFWeH/VUTKw7nEW+mopS3JQ HJ16gfXZvTUBdfduN89+GpmAyjhk84C/JH0M0/VCmOrXT+v8b5WoarKKcURerbvRD8VZaTflXY 7kKQT/BwjII9VnRsbWkTttbV64A9BL2mnyGxniu8fhc0qQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=lURSnezed6DGRTkk7OxAA6eE9q7FL16k6vw0WAIrnHs=; b=GOEpf7Z8GPd9UcGAWgRm2n+6VQ rluiRzyYwfvuxRquEp9Gxjnk9sJjTs0EcMRkICkv94uQXjA7HOidbDX1MgzX6hEn3cnPlZHZCvCGq mYgJf1Sv6j9d/y7N3jDaTzbGoyR9OR0HU6Sf3IK0B8nMXFs+acux8DpwGmm/plLyEu3o17LDDeifN Br0Bl/5CzHJ0uyiTIlDILErgJpo0rQOlMQR62RROMgEgh+xxXqqQgBT0u7a4dCq8MdvWglneEQttx d+GysHQhYcl987Z98+9tbj7ZhOOr9MyUY5aBvlIbfvpJmzNiomXZo2cGkSZh9TDqybStHh/ViNyOP yqbfEoJw==; Received: from authenticated user by zero.zsh.org with local id 1l44kM-000LGR-QW; Mon, 25 Jan 2021 16:29:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f49.google.com) smtp.remote-ip=209.85.166.49; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-io1-f49.google.com ([209.85.166.49]:44232) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1l44jr-000KtW-Rb; Mon, 25 Jan 2021 16:29:18 +0000 Received: by mail-io1-f49.google.com with SMTP id h11so27590816ioh.11 for ; Mon, 25 Jan 2021 08:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lURSnezed6DGRTkk7OxAA6eE9q7FL16k6vw0WAIrnHs=; b=KjICIIk2Zw2Vgq+aDL9miNHJ6QeOish1L0MENmL0wjXYCks2pekoF36yGEF3bCh867 fYZF9tWpohqKrar0TKcpvD1TSNRyXfns2DI3phV8JEVR2tbiVcLdEdfqu/pkAMm8SuGI nI3CidXOoTZm3oX8JIc4DLQjTKcNfylAgOw4geAG15TVpHEYNSK8r4V95msJqYeLpROG YFGpWPJTXHfv3PkAiJc5c7qjH0/mLLQIyUqvsQd9ZfXNegqOGiGkmK0iRnbtFisCTarf FUxR0pwYM+HulNc/JPj7aMH+ah9zIdaRjbAMkBzRQMVzZiqr63/wiym8ai3yK7n6WcnF sLnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lURSnezed6DGRTkk7OxAA6eE9q7FL16k6vw0WAIrnHs=; b=m0CHTMLVloqeGe1b5adrwQhY0bSto1BEPSprQYqnSrnuoOQfqP0id8T9Eh6xRgdlso iMyeagFQQJHPfNxrGHyVXeSxWM2BFXebH1fybaXdd6nVsvYexq1bRkvjyRCsc2Kl7GVv 4PSiW4L9LfAQsKXat7zJD9plSAMU2H8Ow/gZaZeXedwpg1YrKu29wrFCa5UchmZlAUsE 0yBhOWIDpU/uEcH77HRXPXpet58k6nY3aWAM5OY1TJWVYDE+h7YucmQlaWAvEBGYO3KM +oNFVxU0kKAKk+fYAOawDG6VsrfS/+h3rMM1WiHuWU+cE2isA4zjYiKjE7WtykFotLva pIUQ== X-Gm-Message-State: AOAM531tlOPDGykl69sPs1ZjsQHqaIhLmGGrw6OLRXae0xbiQeObNJQo sKJ5jwK8mKT6VDGDNvVmi2x9JFGmAYqqGu/jD48= X-Google-Smtp-Source: ABdhPJyjAtqvMqw7k1cWTnZWhy5Gpflr3FPornfUiRUmGhdCEp7Jwq6jsHlA2vE9Ml5z/daXMtdR6Dv/xvo8rMVQB2s= X-Received: by 2002:a92:6f12:: with SMTP id k18mr1066577ilc.66.1611592154567; Mon, 25 Jan 2021 08:29:14 -0800 (PST) MIME-Version: 1.0 References: <1eb9835c-3911-d4ea-6456-d9ad52ceffea@eastlink.ca> <20210124194750.dtyacd5emjauwxec@sym.noone.org> <38504cf6-a3c0-eb22-8a0b-6410d27ebbbc@eastlink.ca> In-Reply-To: From: Pier Paolo Grassi Date: Mon, 25 Jan 2021 17:28:38 +0100 Message-ID: Subject: Re: capture stderr in command substitution To: Vin Shelton Cc: Ray Andrews , Zsh-Users List Content-Type: multipart/alternative; boundary="000000000000e55abb05b9bc0928" X-Seq: 26416 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --000000000000e55abb05b9bc0928 Content-Type: text/plain; charset="UTF-8" > how do you keep a command out of history? I do it this way: precmd(){ [[ $________tmp___restore_history -eq 1 ]] && { unset ________tmp___restore_history fc -P } } execute_no_history(){ # disable history, will be reactivated in precmd fc -p /dev/null ________tmp___restore_history=1 zle accept-line } zle -N execute_no_history bindkey '^[M' execute_no_history # my keybinding, customize it as you like best Pier Paolo Grassi Il giorno lun 25 gen 2021 alle ore 16:55 Vin Shelton < acs@alumni.princeton.edu> ha scritto: > > how do you keep a command out of history? > > You can > > setopt HIST_IGNORE_SPACE > > (capitalization and underscores don't matter) and put a space in front of > the command. > > Regards, > Vin > > --000000000000e55abb05b9bc0928 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> how do you keep a command out o= f history?=C2=A0

I do it this way:

=
precmd(){
=C2=A0 =C2=A0 [[ $________tmp___restore_history -eq= 1 ]] && {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 unset ________tmp___resto= re_history
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fc -P
=C2=A0 =C2=A0 }
}
=

execute_no_history(){
=C2=A0 =C2=A0 # disable = history, will be reactivated=C2=A0in precmd
=C2=A0 =C2=A0 fc -p /dev/nul= l
=C2=A0 =C2=A0 ________tmp___restore_history=3D1

=C2=A0 =C2=A0 z= le accept-line
}
zle -N execute_no_history
bindkey '^[M' e= xecute_no_history # my keybinding, customize it as you like

<= /div>
best

Pier Paolo Grassi


Il giorno lun 25 gen 2021 alle ore 16:5= 5 Vin Shelton <acs@alumni.pr= inceton.edu> ha scritto:
> how do you keep a command out of history?

You can

setopt HIST_IGNORE_SPACE

(capitalization an= d underscores don't matter) and put a space in front of the command.

Regards,
=C2=A0 Vin

--000000000000e55abb05b9bc0928--