Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: append to history entry?
- X-seq: zsh-users 22285
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Subject: Re: append to history entry?
- Date: Tue, 27 Dec 2016 12:55:30 +0000
- Cc: zsh-users@xxxxxxx
- 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=
- In-reply-to: <5288b537-f06a-d18a-60ea-1f962856c80c__41345.3811700039$1482803962$gmane$org@eastlink.ca>
- 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: <a18cf6d4-9fcb-7758-599e-4a56d2258824@eastlink.ca> <5288b537-f06a-d18a-60ea-1f962856c80c__41345.3811700039$1482803962$gmane$org@eastlink.ca>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author