From: Peter Stephenson <pws@csr.com>
To: zsh-users@sunsite.dk
Subject: Re: 1simple? questions
Date: Mon, 18 Jul 2005 14:01:30 +0100 [thread overview]
Message-ID: <22192.1121691690@csr.com> (raw)
In-Reply-To: <mk8nd1huhrps0pp47mqvov5brmrl22s8dm@4ax.com>
zzapper wrote:
> Hi,
> Q1
> How can I echo/print an array with a carriage return after each element. Do I
> have to use a loop?
Just use rc_expand_param:
print ${^array}\\r
Careful, however: you still get the spaces between elements from
"print". You can suppress those by joining the array elements first
using print escapes:
print ${(pj:\r:)array}
(You did mean carriage return, didn't you? You didn't simply want to
print one element of the array per line
print -l $array
?)
pws
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
next prev parent reply other threads:[~2005-07-18 13:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-18 12:43 zzapper
2005-07-18 13:01 ` Peter Stephenson [this message]
2005-07-18 13:25 ` Nikolai Weibull
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=22192.1121691690@csr.com \
--to=pws@csr.com \
--cc=zsh-users@sunsite.dk \
/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).