Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
can I control brace expansion's "sort"/"display" order?
- X-seq: zsh-users 13173
- From: Eric De Mund <ead@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: can I control brace expansion's "sort"/"display" order?
- Date: Sun, 31 Aug 2008 02:34:54 -0700
- Disposition-notification-to: ead@xxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Reply-to: Eric De Mund <ead@xxxxxxxxx>
Hello,
Can I control brace expansion's "sort" or "display" order?
For instance this zsh echo results in this output:
% echo {white,black}{bird,fish}{21..24} | tr ' ' '\n'
# current output order
whitebird21
whitebird22
whitebird23
whitebird24
whitefish21
whitefish22
whitefish23
whitefish24
blackbird21
blackbird22
blackbird23
blackbird24
blackfish21
blackfish22
blackfish23
blackfish24
%
But what if instead of this order I wanted the last brace to cycle most
slowly, followed by the first, followed by the second, like so:
% echo {white,black}{bird,fish}{21..24} | tr ' ' '\n'
# desired output order
whitebird21
whitefish21
blackbird21
blackfish21
whitebird22
blackbird22
whitefish22
blackfish22
whitebird23
whitefish23
blackbird23
blackfish23
whitebird24
whitefish24
blackbird24
blackfish24
%
Is there any way to accomplish this?
My problem is that I'm trying to get files added to a zip archive in a
particular order, and this order is neither brace expansion sort/display
order nor lexicographical order.
Thank you,
Eric
p.s. I have a kludge solution of placing all these names in a text
file and rearranging them according to an Emacs macro, but I'm looking
to avoid that kind of error-prone, manual solution.
--
Eric De Mund | Ixian Systems | Jab: eadixian@xxxxxxxxxx/main
ead@xxxxxxxxx | 650 Castro St, #120-210 | Y!M: ead0002
ixian.com/ead/ | Mountain View, CA 94041 | ICQ: 811788
Messages sorted by:
Reverse Date,
Date,
Thread,
Author