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

Re: Effect of typeset -U for colon separated paths?



On Dec 14,  3:00pm, Hannu Koivisto wrote:
}
} BAR=foo:bar:baz
} foo=(${(s:::)BAR}
} 
} ...but s expansion flag couldn't split with plain ":" (for
} understandable reasons).  I couldn't figure out any working way to
} quote it either.

Andrej has already mentioned "typeset -T", but to quote the doc for the
flags j, l, r, s, etc.:

 The following flags (except p) are followed by one or more arguments as
 shown.  Any character, or the matching pairs `(...)', `{...}', `[...]',
 or `<...>', may be used in place of a colon as delimiters, but note
 that when a flag takes more than one argument, a matched pair of
 delimiters must surround each argument.

So for example:

    BAR=foo:bar:baz
    foo=(${(s.:.)BAR})



-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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