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

Re: newline grief



On 02/10/2018 02:02 PM, Ray Andrews wrote:
> I've been through this before, butI can't remember the answer:
> 
> $ typeset -m 'var*'
> var1='this is var1'
> var2='this is var2'
> var3='this is var3'
> 
> $ for aa in `typeset -m 'var*'`; do
>  print ${aa}
> done
> 
> var1='this
> is
> var1'
> var2='this
> is
> var2'
> var3='this
> is
> var3'
> varis=''
> var=''
> 
> How do I get each variable to print on one line?  Sorry, I should know this.
> 
> 
for aa in "${(f)$(typeset -m 'var*')}"; do
....

While all of it isn't applicable to zsh: this explains what happened in your case:
http://mywiki.wooledge.org/DontReadLinesWithFor



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