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

Re: Expand array into multiple elements per item?



On 13 Sep, "Benjamin R. Haskell" wrote:
> > You can try this :
> > print -l -- "-id "$^somelist
> 
> anotherlist should end up as I specified before:
> 
>      $ anotherlist=( -id 'a b' -id c -id 'd e' )
> 
> I.e. separate elements, but not just word-splitting everything:

If you join the list up and then re-split it, it might work:
  print -l -- ${(0)${(pj:\0:):--id$'\0'$a}}

Oliver



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