zsh-users
 help / color / mirror / code / Atom feed
From: lists@necoro.eu
To: zsh-users@zsh.org
Subject: Re: ls -l *(/)...
Date: Mon, 22 Jun 2015 21:26:36 +0200	[thread overview]
Message-ID: <5588616C.5090109@necoro.eu> (raw)
In-Reply-To: <20150622190837.GA9569@ramirez.u-strasbg.fr>

Am 22.06.2015 um 21:08 schrieb Marc Chantreux:
>> Of course you can also iterate over them:
>> for f in */*; echo $(basename $f) 
> 
> print -l */*:t 

Thanks, but I just intended the for-loop as a small one-line example :).
Because I thought that the original intention might have been something
along the lines of

for f in `ls */*`; ...

or

ls */* | ...

Also, while such short one-liners using different modificators and
qualifiers and what not are nice to show case the might of zsh, I often
find them confusing and actually like an explicit for-loop more (except
when the for-loop makes stuff more complicated). The reason is, that I
write longer zsh-scripts so seldom that I always forget what all those
magic letters are for. So I need either a lengthy comment or I always
have to read zsh manpages when I happen to stumble of the piece in
question again.

(Just for the record, though, :t is one of the very few things I
actually use :), though I'd probably do echo */*(:t))

Best,
René


  reply	other threads:[~2015-06-22 19:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22  3:17 Meino.Cramer
2015-06-22  5:25 ` lists
     [not found]   ` <20150622163654.GB4560@solfire>
2015-06-22 17:59     ` lists
2015-06-22 18:30       ` Bart Schaefer
2015-06-22 21:28         ` Bernd Steinhauser
2015-06-22 19:08       ` Marc Chantreux
2015-06-22 19:26         ` lists [this message]
2015-06-22 20:31           ` Roman Neuhauser
2015-06-23 11:30           ` Marc Chantreux

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=5588616C.5090109@necoro.eu \
    --to=lists@necoro.eu \
    --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).