From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6740 invoked by alias); 16 Jun 2016 15:42:41 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21676 Received: (qmail 5177 invoked from network); 16 Jun 2016 15:42:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=pCiRRtolhGHH1GHFzdrqtToDAMQb1vTky9AwVVIwFlo=; b=UQkU3odI8kDqmlw6yJQTOQgmRqwuZd7Wpzurq2REH3Y/y+M4Py18Fofka+sE0JirGq rNK5sU3jues1O9lFvFlbcc+HP2ldwO3SkhzsxeK/OgVW9e3hSEzo580BB24Cg3xp2U9Z ggIbbbVXJ4IpXxYc/fJCptWtOF4+I/ikqbSkvczWqBq6Yulic+E7e42sXKKOFplQhS8c qDJMBYOETcpEIOxjYF7nSignXixSAff39YDBcUQZvkqPKt4UauS0g/+ww8MOX4NIBFbp QWnr88DuVEsNWaUXjNmLlfUz3pA35fEfn7bPdwwPjRUEHQRYz7mMLZQeUYJ+z+P/TWUC pl+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=pCiRRtolhGHH1GHFzdrqtToDAMQb1vTky9AwVVIwFlo=; b=GjNfydAVJBKN8q3PStcT8UljJ6Sedi77NySHEXM+/wEqrPmlCtT0uyj91TAVhuQyJk Pgf7ndDDHTFXL2+8bzoqpzoc27cx03KIrweXUeuICvvL+dXWlxC4zH4l+ruaRI/blEe1 wjU0Kw5DUmGIeWiNRU6LM63n/fgKZMelkFs21NMPvaMvMeT0mqizYbAKuRAzq47t2g8q bjscQDDkA/SEHy6seE6kdkiN2Dq5KFVUFbdk7wS5Pic3z/CUjcMX/5Ee44NdBxavL3tf PXJzYtZL8eS2kVg/AgX8VVn7hncnr9HTU5wBjz0VUjU4dDKgl9rRjao+Qub8lL0tM7Nd lSiQ== X-Gm-Message-State: ALyK8tLWnnzS54qW8LSpsjNzu0uKUK2L3wvgjNRgrPIhnjyu5qA9Q5Q7rEkDYUhekhFGCw== X-Received: by 10.66.54.35 with SMTP id g3mr5983852pap.30.1466091756584; Thu, 16 Jun 2016 08:42:36 -0700 (PDT) From: Bart Schaefer Message-Id: <160616084300.ZM24705@torch.brasslantern.com> Date: Thu, 16 Jun 2016 08:43:00 -0700 In-Reply-To: Comments: In reply to Mikael Magnusson "Re: Feature request: two level sorting" (Jun 16, 1:02am) References: <160615101239.ZM21280@torch.brasslantern.com> <160615153817.ZM22021@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Feature request: two level sorting MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 16, 1:02am, Mikael Magnusson wrote: } } Well, this old trick always works if you don't mind depending on / } being readable, but that's probably a safe assumption usually. } } % myarray=("aaa-A" "aab-B" "aac-A" "aad-C") } % echo /(e:'reply=($myarray)':oe:'REPLY=${REPLY#*-}':) } aac-A aaa-A aab-B aad-C Heh, you don't even need / to be readable, any single readable file will do: torch% echo /dev/null(e:'reply=($myarray)':oe:'REPLY=${REPLY#*-}':) aac-A aaa-A aab-B aad-C Rather hard to embed that in a parameter expansion context without using a process substitution, though. And I don't think it covers the secondary sort: note that in Sebastian's original example he wants (aaa-A aac-A) but the above output has them the other way (the sort isn't guaranteed to be stable).