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

Re: globbing in assignment



On Wed, 23 May 2012 18:08:46 +0800
Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
> Thanks for reply. I don't set globassign in the interactive shell but
> the globbing is working in assigment. And finally I find out it's
> "glob_subst" which also has the same effect of "glob_assign".

Ah, you're misunderstanding what's going on.

GLOB_ASSIGN has the effect that

v=*

expands * at this point.  The value of v contains all the files.

GLOB_SUBST has the effect that a variable is expanded at the point where
it's substituted.  So without GLOB_ASSIGN, or equivalently quoting the
value assigned to v,

% v='*'
% setopt globsubst
% print $v
<files>
% unsetopt globsubt
% print $v
*

-- 
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
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog



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