From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19759 invoked by alias); 14 Jun 2010 09:54:50 -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: 15120 Received: (qmail 2836 invoked from network); 14 Jun 2010 09:54:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Mon, 14 Jun 2010 10:02:44 +0100 From: Peter Stephenson To: "Dan Luther" Cc: Subject: Re: Using variables in command substitution Message-ID: <20100614100244.04f82d61@csr.com> In-Reply-To: <001201cb0b89$63e2e3b0$2ba8ab10$@net> References: <001201cb0b89$63e2e3b0$2ba8ab10$@net> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; i686-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 14 Jun 2010 09:02:45.0965 (UTC) FILETIME=[5B00E7D0:01CB0BA0] X-Scanned-By: MailControl A_09_40_00 (www.mailcontrol.com) on 10.68.1.159 On Mon, 14 Jun 2010 01:18:13 -0500 "Dan Luther" 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 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