zsh-users
 help / color / mirror / code / Atom feed
From: Christian Taylor <cht@chello.at>
To: "zsh-users" <zsh-users@sunsite.dk>
Subject: Re: Sorting files
Date: Fri, 5 Aug 2005 14:57:18 +0200	[thread overview]
Message-ID: <200508051457.18672.cht@chello.at> (raw)
In-Reply-To: <g3h6f1tsnq5ae63mane269rma0ao8r3ua3@4ax.com>

zzapper wrote:
> >Meino Christian Cramer wrote:
> >>  I played around with combinations including expressions like
> >>  **/*(.,oL) trying to get a listing of all files found !including
> >>  those of the subdirectories! sorted by their size. I want one big
> >>  listing sorted "once" -- but I got "seperated" parts sorted each for
> >>  themselves.
>
> Any chance of a summary of this interesting thread (assuming it's
> finished)?

I don't know if the thread is finished yet, but I'll try to sum up the things 
I've learned so far. I'm no zsh expert, so pointing out errors would be much 
appreciated:

According to the user guide and the actual behaviour of zsh (4.2.5) on my 
system, this should do exactly what Meino wants, sorting all files by size 
"in one go" (files from different subdirectories mixed together):

print -l -- **/*(.oL)

However, Meino replied to a similar suggestion "This gave me no sorted 
output...sorry :O)" - unfortunately, I have no idea why this is so.

"print -l -- **/*(.,oL)" also sorts in one go, but unintentionally includes 
EVERYTHING, because no glob qualifier other than sorting is given after the 
comma ("match everything that is a regular file or anything at all").

The "od" sort option that was suggested puts files in subdirectories before 
those in the current directory at each level of the search. "Od" does the 
reverse.
The results of "**/*(.odoL)" seem a bit unexpected at first, because files of 
all subdirectories are mixed together, but still all files of every 
subdirectory appear before files in the respective parent directory, and the 
whole list is sorted by size as far as this constraint allows.
"**/*(.odL)" doesn't work - zsh interprets the L as the regular size glob 
qualifier with a missing size specification, because every sort qualifier has 
to be directly preceded by "o" or "O".
However, if I understood Meino's goal correctly, he'll want neither "od" nor 
"Od" in his glob qualifier.

That's about it, I hope this helps someone,
Christian


  reply	other threads:[~2005-08-05 12:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-04 18:38 Meino Christian Cramer
2005-08-04 18:48 ` Mikael Magnusson
2005-08-04 19:10   ` Meino Christian Cramer
2005-08-04 19:18     ` Danek Duvall
2005-08-04 20:41       ` Stephane Chazelas
2005-08-05  3:01         ` Meino Christian Cramer
2005-08-05 10:47           ` Stephane CHAZELAS
2005-08-04 19:14 ` Christian Schneider
2005-08-04 21:19   ` Jens Kubieziel
2005-08-05  3:06   ` Meino Christian Cramer
2005-08-04 19:51 ` Christian Taylor
2005-08-05 10:51   ` zzapper
2005-08-05 12:57     ` Christian Taylor [this message]
2005-08-05 14:41     ` Meino Christian Cramer
2005-08-06  5:38     ` Summary: " Meino Christian Cramer
2005-08-06  9:22       ` Christian Taylor
2005-08-05 12:52 ` DervishD
2005-08-05 14:01   ` Meino Christian Cramer
2005-08-05 14:29     ` Mikael Magnusson

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=200508051457.18672.cht@chello.at \
    --to=cht@chello.at \
    --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).