Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Using variables in command substitution



On Mon, 14 Jun 2010 01:18:13 -0500
"Dan Luther" <dan@xxxxxxxxxxxxxx> 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@xxxxxxx>            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



Messages sorted by: Reverse Date, Date, Thread, Author