Re: Numerically sorted arguments (in shell)

Liste des GroupesRevenir à cu shell 
Sujet : Re: Numerically sorted arguments (in shell)
De : nn.throttle (at) *nospam* xoxy.net (Helmut Waitzmann)
Groupes : comp.unix.shell
Date : 16. Jun 2024, 21:52:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <83sexcll5x.fsf@helmutwaitzmann.news.arcor.de>
References : 1 2 3 4 5
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)
 Janis Papanagnou <janis_papanagnou+ng@hotmail.com>:
How would the main function look like that I could embed in my call to make a numerically sorted list. Say, something like, for example, >
>
  viewer $( p_sort P*.HTM )
>
where p_sort would be the Python code. - Note: this is no appropriate solution since it would anyway not work correctly for file names with embedded blanks and newlines. I just want to get a closer understanding how you think this would be usable in shell (or from shell). Thanks. >
 If ‘p_sort’ is designed to output the sorted file names separated  by an ASCII NUL character rather than a newline then, using the  GNU version of ‘xargs’, one can feed that output into ‘xargs’:    {
     p_sort P*.HTM 3<&- |
     xargs --null --no-run-if-empty -- sh -c \
     'exec 0<&3 3<&- "$@"' sh \
     viewer
   } 3<&0
 This will avoid the problems with funny characters (including  blanks and linefeeds) in filenames processed by the shell.
Date Sujet#  Auteur
14 Jun 24 * Numerically sorted arguments (in shell)46Janis Papanagnou
15 Jun 24 +* Re: Numerically sorted arguments (in shell)2Axel Reichert
15 Jun 24 i`- Re: Numerically sorted arguments (in shell)1Janis Papanagnou
16 Jun 24 +* Re: Numerically sorted arguments (in shell)20Lawrence D'Oliveiro
16 Jun 24 i`* Re: Numerically sorted arguments (in shell)19Janis Papanagnou
16 Jun 24 i +* Re: Numerically sorted arguments (in shell)14Lawrence D'Oliveiro
16 Jun 24 i i`* Re: Numerically sorted arguments (in shell)13Janis Papanagnou
16 Jun 24 i i +* Re: Numerically sorted arguments (in shell)4Helmut Waitzmann
17 Jun 24 i i i+- Re: Numerically sorted arguments (in shell)1Janis Papanagnou
18 Jun 24 i i i`* Re: Numerically sorted arguments (in shell)2Geoff Clare
19 Jun 24 i i i `- Re: Numerically sorted arguments (in shell)1Helmut Waitzmann
17 Jun 24 i i `* Re: Numerically sorted arguments (in shell)8Lawrence D'Oliveiro
17 Jun 24 i i  `* Re: Numerically sorted arguments (in shell)7Janis Papanagnou
17 Jun 24 i i   `* Re: Numerically sorted arguments (in shell)6Lawrence D'Oliveiro
17 Jun 24 i i    `* Re: Numerically sorted arguments (in shell)5Janis Papanagnou
18 Jun 24 i i     `* Re: Numerically sorted arguments (in shell)4Lawrence D'Oliveiro
18 Jun 24 i i      +- Re: Numerically sorted arguments (in shell)1Kenny McCormack
18 Jun 24 i i      +- Re: Numerically sorted arguments (in shell)1Janis Papanagnou
19 Jun 24 i i      `- Re: Numerically sorted arguments (in shell)1Kaz Kylheku
16 Jun 24 i `* Re: Numerically sorted arguments (in shell)4Eric Pozharski
17 Jun 24 i  `* Re: Numerically sorted arguments (in shell)3Janis Papanagnou
18 Jun 24 i   `* Re: Numerically sorted arguments (in shell)2Eric Pozharski
19 Jun 24 i    `- Re: Numerically sorted arguments (in shell)1Janis Papanagnou
18 Jun 24 +* Re: Numerically sorted arguments (in shell)5Chris Elvidge
18 Jun 24 i`* Re: Numerically sorted arguments (in shell)4Janis Papanagnou
18 Jun 24 i `* Re: Numerically sorted arguments (in shell)3Chris Elvidge
18 Jun 24 i  `* Re: Numerically sorted arguments (in shell)2Janis Papanagnou
18 Jun 24 i   `- Re: Numerically sorted arguments (in shell)1Janis Papanagnou
18 Jun 24 `* Re: Numerically sorted arguments (in shell)18Janis Papanagnou
19 Jun 24  `* Re: Numerically sorted arguments (in shell)17Chris Elvidge
19 Jun 24   `* Re: Numerically sorted arguments (in shell)16Janis Papanagnou
19 Jun 24    `* Re: Numerically sorted arguments (in shell)15Chris Elvidge
20 Jun 24     +* Re: Numerically sorted arguments (in shell)11vallor
20 Jun 24     i+- Re: Numerically sorted arguments (in shell)1Janis Papanagnou
20 Jun 24     i+* Re: Numerically sorted arguments (in shell)6Janis Papanagnou
21 Jun 24     ii`* Re: Numerically sorted arguments (in shell)5vallor
21 Jun 24     ii `* Re: Numerically sorted arguments (in shell)4Lawrence D'Oliveiro
21 Jun 24     ii  `* Re: Numerically sorted arguments (in shell)3vallor
21 Jun 24     ii   `* Re: Numerically sorted arguments (in shell)2Lawrence D'Oliveiro
21 Jun 24     ii    `- Re: Numerically sorted arguments (in shell)1Kenny McCormack
21 Jun 24     i`* Re: Numerically sorted arguments (in shell)3Chris Elvidge
24 Jun 24     i `* Is 'ls -v' the Final Solution? (Was: Numerically sorted arguments (in shell))2Kenny McCormack
24 Jun 24     i  `- Re: Is 'ls -v' the Final Solution? (Was: Numerically sorted arguments (in shell))1Janis Papanagnou
20 Jun 24     `* Re: Numerically sorted arguments (in shell)3Janis Papanagnou
24 Jun 24      `* Re: Numerically sorted arguments (in shell)2Chris Elvidge
24 Jun 24       `- Re: Numerically sorted arguments (in shell)1Janis Papanagnou

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal