From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17214 invoked by alias); 26 Feb 2012 18:32:24 -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: 16795 Received: (qmail 6493 invoked from network); 26 Feb 2012 18:32:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120226103202.ZM7597@torch.brasslantern.com> Date: Sun, 26 Feb 2012 10:32:02 -0800 In-reply-to: Comments: In reply to Moritz Bunkus "Re: s/pattern/pattern/g on the commandline ?" (Feb 25, 7:46pm) References: <20120225182450.GA31597@solfire> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: s/pattern/pattern/g on the commandline ? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Feb 25, 7:46pm, Moritz Bunkus wrote: } } while we're at it: is there a way to do history expansion without } actually submitting the modified entry? I kept waiting for someone to mention this, but no one has yet ... 14.1.4 Modifiers ---------------- p Print the new command but do not execute it. Only works with history expansion. You can stack modifiers, so !!:p:gs/what/ever or !!:gs/what/ever/:p will both work. Note you need the trailing slash in the second case. Other delimiters work for s/// -- you can even use a colon, so !:2:s:what:ever::p means to take the second word of the previous command, change "what" to "ever" in that word, and then display the result (and enter it into the history list) without actually executing it.