Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: 'for' sorted?
- X-seq: zsh-users 28118
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: 'for' sorted?
- Date: Thu, 22 Sep 2022 08:54:58 -0700
- Archived-at: <https://zsh.org/users/28118>
- In-reply-to: <CAFOazANc=koWaYxdXAK2x7rQJtsTxhaxY23doNwgZYmAQ6xfFw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <49e39986-c9d4-fc8a-3ee2-f484f44cff4c@eastlink.ca> <CAFOazANc=koWaYxdXAK2x7rQJtsTxhaxY23doNwgZYmAQ6xfFw@mail.gmail.com>
On 2022-09-22 08:26, Jérémie Roquet wrote:
Lexical order:
for var in /dev/sd*(on); do
To see the available sort specifiers, use:
for var in /dev/sd*(o<tab>
Best regards,
Bloody marvelous, <tab> there to give you your options, I had no idea
there was any such thing.
9 /aWorking/Zsh/Source/Wk 1 $ for aa in /dev/sda*(on); do echo $aa; done
/dev/sda
/dev/sda1
/dev/sda10
/dev/sda11
/dev/sda12
/dev/sda13
/dev/sda2
/dev/sda3
/dev/sda4
/dev/sda5
/dev/sda6
/dev/sda7
/dev/sda8
/dev/sda9
Now, what would be idyllic is to be able to have version sort so that
the output is this:
/dev/sda
/dev/sda1
/dev/sda2
/dev/sda3
/dev/sda4
/dev/sda5
/dev/sda6
/dev/sda7
/dev/sda8
/dev/sda9
/dev/sda10
/dev/sda11
/dev/sda12
/dev/sda13
Thanks Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author