From: "Dan Luther" <dan@theluthers.net>
To: "'Peter Stephenson'" <Peter.Stephenson@csr.com>
Cc: <zsh-users@zsh.org>
Subject: RE: Using variables in command substitution
Date: Mon, 14 Jun 2010 09:58:33 -0500 [thread overview]
Message-ID: <002601cb0bd2$10f28cc0$32d7a640$@net> (raw)
In-Reply-To: <20100614100244.04f82d61@csr.com>
Thanks -- this fixed my problem. You have to escape the "|" character, e.g.:
HNAME=(uname -n \| cut -d. -f1)
. . .
Thank you again for prompt reply!
-----Original Message-----
From: Peter Stephenson [mailto:Peter.Stephenson@csr.com]
Sent: Monday, June 14, 2010 4:03 AM
To: Dan Luther
Cc: zsh-users@zsh.org
Subject: Re: Using variables in command substitution
On Mon, 14 Jun 2010 01:18:13 -0500
"Dan Luther" <dan@theluthers.net> wrote:
> I'm trying to unify my .zshrc across a couple of platforms, and I ran
> across an interesting ZSH behavior. Essentially, I want to assign a
> variable to the name of a specific command for later substitution:
You're hitting the fact that zsh doesn't split scalar variables
automatically. See http://zsh.sourceforge.net/FAQ/zshfaq03.html#l18 .
A quick fix for the commands is to use arrays:
ME=(/usr/xpg4/bin/id -un)
etc.
--
Peter Stephenson <pws@csr.com> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ,
UK
Member of the CSR plc group of companies. CSR plc registered in England and
Wales, registered number 4187346, registered office Churchill House,
Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.829 / Virus Database: 271.1.1/2934 - Release Date: 06/13/10
14:45:00
next prev parent reply other threads:[~2010-06-14 15:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-14 6:18 Dan Luther
2010-06-14 9:02 ` Peter Stephenson
2010-06-14 14:58 ` Dan Luther [this message]
2010-06-14 13:36 ` Benjamin R. Haskell
2010-06-14 16:57 ` Dan Luther
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='002601cb0bd2$10f28cc0$32d7a640$@net' \
--to=dan@theluthers.net \
--cc=Peter.Stephenson@csr.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).