Sujet : Re: Numerically sorted arguments (in shell)
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shellDate : 24. Jun 2024, 17:22:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v5c2uq$107jo$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 24.06.2024 16:22, Chris Elvidge wrote:
[...]
Originally you said:
(Ideally I'd also like to handle names with two numbers "A35P56.txt"
and irregular string components (lowercase, say, "page310ch1.txt"),
but that's just a nice-to-have. - I might make use of 'sort'?)
Does 'sort -V' help?
Seems to work with both spaces and newlines.
Yes, that would help like 'ls -v' does (presuming it behaves similar;
I haven't extensively tried 'sort -V' yet). (But using 'ls | sort -V'
is not that terse like 'ls -v'.) The problem with both external tools
is (as outlined upthread) the post-processing of the tool-generated
list of data in shell context. So both tools take some burden from
me (the sorting aspect is simply covered by an option), but doesn't
help me how I can safely post-process the identified items. (A shell
built-in could natively better, i.e. simpler and more consistently,
address that.)
Janis