From: zzapper <david@tvis.co.uk>
To: zsh-users@sunsite.dk
Subject: Re: printing arrays and index
Date: Sun, 24 Jul 2005 07:46:45 +0100 [thread overview]
Message-ID: <u9e6e15ne4bf41q6ikm2f2tpf9568eqf0a@4ax.com> (raw)
In-Reply-To: <1050723045916.ZM10289@candle.brasslantern.com>
On Sat, 23 Jul 2005 04:59:15 +0000, wrote:
>On Jul 22, 7:08pm, zzapper wrote:
>} Subject: printing arrays and index
>}
>} I'm using
>}
>} print -C 1 $filessubject
>
>I was sort of puzzled by why that was suggested. "print -l" (that's a
>lowercase L, not a one) has the same effect, and works in a lot more
>versions of zsh (the -C option is a very recent addition).
>
>} I know want to precede each array entry with it's index number 1,2,3, etc
>}
>} how do?
>
>The most obvious way is:
>
> print -l $filessubject | cat -n
>
>But something like this works too:
>
> i=0 eval print -l '$((++i))\ '${(q)^filessubject}
>
>If you use 'setopt ksharrays' then change that to $((i++)).
Thx JWTDO
--
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips
prev parent reply other threads:[~2005-07-24 6:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-22 18:08 zzapper
2005-07-23 4:59 ` Bart Schaefer
2005-07-24 6:46 ` zzapper [this message]
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=u9e6e15ne4bf41q6ikm2f2tpf9568eqf0a@4ax.com \
--to=david@tvis.co.uk \
--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).