zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: Zsh Users <zsh-users@sunsite.dk>
Subject: Re: globbing with interposition
Date: Tue, 19 Apr 2005 16:59:04 +0100	[thread overview]
Message-ID: <200504191559.j3JFx4oJ002120@news01.csr.com> (raw)
In-Reply-To: <1050419152554.ZM31922@candle.brasslantern.com>

Bart Schaefer wrote:
> For bizarre reasons I don't immediately understand, the following does
> what you want, but probably isn't guaranteed to keep working in future
> releases:
> 
>     mutt eric fotos*(e:'reply=($REPLY -a)':od) -s "all images attached"

od doesn't sort at all, which is sort of implied by:

    if d, files in subdirectories appear before  those
    in the current directory at each level of the search --- this is
    best combined with other criteria, for example `odon' to sort on
    names  for files within the same directory

The effect of "not sorting at all" is likely to be that the files are
read in inode order, except it's not documented how they are likely to
be inserted into the final list.  It does seem that they're reversed on
Linux:

  % touch a b c d
  % print *(od)
  d c b a
  % rm b
  % touch e
  % print *(od)
  d c e a

The reversal is not an effect of the (od) itself, which simply returns a
the difference of the number of slashes in the file, i.e. zero.  It
looks like it's a side effect of qsort when two files compare equal.
The qsort documentation says:

    The relative order in the output of two items  that  compare
    as equal is unpredictable.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
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.

**********************************************************************


  parent reply	other threads:[~2005-04-19 23:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-19  7:21 Eric Smith
2005-04-19  7:50 ` DervishD
2005-04-19  8:22 ` J
2005-04-19  8:35   ` DervishD
2005-04-19 15:25   ` Bart Schaefer
2005-04-19 15:36     ` J
2005-04-19 15:59     ` Peter Stephenson [this message]
2005-04-19 16:22       ` Bart Schaefer
2005-04-19 16:46     ` DervishD
2005-04-19 18:36 ` Oliver Kiddle
2005-04-21 10:45   ` globbing with interposition -> rocking Eric Smith - Fruitcom

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=200504191559.j3JFx4oJ002120@news01.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).