zsh-users
 help / color / mirror / code / Atom feed
From: Eric Cook <llua@gmx.com>
To: zsh-users@zsh.org
Subject: Re: newline grief
Date: Sat, 10 Feb 2018 14:46:25 -0500	[thread overview]
Message-ID: <e85defb8-e026-2232-33bd-20deb36f330c@gmx.com> (raw)
In-Reply-To: <03c557f4-e55e-f33d-6875-fedbb99212b8@eastlink.ca>

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


  parent reply	other threads:[~2018-02-10 19:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-10 19:02 Ray Andrews
2018-02-10 19:36 ` Bart Schaefer
2018-02-10 19:38   ` Eric Cook
2018-02-10 19:46 ` Eric Cook [this message]
2018-02-10 19:54   ` Daniel Shahaf
2018-02-10 20:09     ` Eric Cook
2018-02-10 21:07       ` Ray Andrews
2018-02-10 21:04     ` Ray Andrews
2018-02-10 21:36       ` Daniel Shahaf
2018-02-10 22:47         ` Ray Andrews
2018-02-10 20:36   ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e85defb8-e026-2232-33bd-20deb36f330c@gmx.com \
    --to=llua@gmx.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).