From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4263 invoked by alias); 27 Dec 2016 12:58:44 -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: 22285 Received: (qmail 6651 invoked from network); 27 Dec 2016 12:58:44 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.25):SA:0(-0.7/5.0):. Processed in 1.603797 secs); 27 Dec 2016 12:58:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=bVAbuJDfapyt681 qWNa++RwUVVM=; b=rYhnlmGiZnL3nm7uszOBBTIpgtrruFUCHkZJIEqART9d9dK wyTi7fMC7qnrC6Vtm6GNiqiuUwsAD+DxYaMBtMzgLDf+Qpfcjcogx5OpMvAHuMCo k2uB0+yOvYbMeRHtn8OI8fF/XYW+iuWDWrqUZpDqQVq7DUO4FqQQsuOFpSoc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=bVAbuJDfapyt68 1qWNa++RwUVVM=; b=nLm4vQ0aISCWoI1W+jhZ//y8YIZXiIdDx5IUsQ7KnRDPhD b1Ze/zmDKbEKTtJapA6Ab5t7CdyMDxvJKbI9ki0DqGoqJf7DjETbpCg3u99R7CMi S890VYLRMhKNuNmCFMZN1iGz+lpRK4GrYZDBqNiAofLbBbABnoqzrrbyzt9o8= X-ME-Sender: X-Sasl-enc: olYJkNKcWwXTugOmeSrstP+GtJQuvxAygnHqOLZsb2wU 1482843512 Date: Tue, 27 Dec 2016 12:55:30 +0000 From: Daniel Shahaf To: Ray Andrews Cc: zsh-users@zsh.org Subject: Re: append to history entry? Message-ID: <20161227125530.GA4796@fujitsu.shahaf.local2> References: <5288b537-f06a-d18a-60ea-1f962856c80c__41345.3811700039$1482803962$gmane$org@eastlink.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5288b537-f06a-d18a-60ea-1f962856c80c__41345.3811700039$1482803962$gmane$org@eastlink.ca> User-Agent: Mutt/1.5.23 (2014-03-12) Ray Andrews wrote on Mon, Dec 26, 2016 at 17:28:05 -0800: > print -S "rap $* ; echo $HOST" This will not reproduce arguments with literal whitespace or backslashes correctly. Two changes are required to support them: 1) Pass -r to print. 2) When interpolating a variable into a command, it should be (q)-esacped. Putting all that and Bart's suggestion together gives: print -rS -- "rap ${(q)@} ; : ${(q)HOST}" [just in case somebody puts a backslash in their hostnames ;)] Cheers, Daniel