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

Re: ls -l *(/)...



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é



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