Lines Matching refs:and
5 @c Permission is granted to copy, distribute and/or modify this document
8 @c Invariant Sections, no Front-Cover Texts, and no Back-Cover
22 @dfn{Version sort} puts items such as file names and lines of
24 contains a mixture of letters and digits.
41 @samp{ls --sort=version}, @samp{sort -V}, and
49 Two GNU Coreutils programs use version sort: @command{ls} and @command{sort}.
103 @node Version sort and natural sort
104 @subsection Version sort and natural sort
113 general input such as textual strings and file names
116 In other contexts, such as other programs and other programming
127 order items. Each program and each programming language can decide its
128 own ordering algorithm and call it ``version sort'', ``natural sort'',
132 differing sorting possibilities, each with its own rules and variations.
150 and Debian version sort.
186 these two parts are compared, and any difference found is returned as
196 equal. For example, @samp{123} compares equal to @samp{00123}, and
201 These two steps (comparing and removing initial non-digit strings and
207 @file{foo07.7z} and @file{foo7a.7z}. The two strings will be broken
208 down to the following parts, and the parts compared respectively from
226 The second parts (@samp{07} and @samp{7}) are compared numerically,
227 and compare equal.
288 value, and compares it to other values. For example, @samp{8.1}, @samp{8.10} and
289 @samp{8.100} are numerically equivalent, and are ordered together. Similarly,
290 @samp{8.49} is numerically less than @samp{8.5}, and appears before first.
292 Version sort (@samp{sort -V}) first breaks down the string into digit and
293 non-digit parts, and only then compares each part (see annotated
297 @samp{8}s are compared (and are identical), then the
298 dots (@samp{.}) are compared and are identical, and lastly the
299 remaining digits are compared numerically (@samp{1} and @samp{01}) --
300 which are numerically equal. Hence, @samp{8.01} and @samp{8.1}
304 and @samp{.} parts are identical, then the numeric values @samp{5} and
337 The fourth parts (@samp{.} and @samp{_src.tar.gz}) are compared
339 less than @samp{_} (ASCII value 95) -- and should be listed before it.
370 (after breaking down a string to digit and non-digit parts).
381 The input strings consist entirely of non-digits, and based on the
398 before other bytes, and before an empty string.
416 non-digit (rule 2) and digit parts (rule 3).
424 and before the empty string -- hence it comes before all other strings,
425 and is listed first in the sorted output.
429 and compares equal. The following extracted parts for the remaining
462 @samp{a} and @samp{z} are letters, and sort before
474 and file name listing.
477 @node Hyphen-minus and colon
478 @subsection Hyphen-minus @samp{-} and colon @samp{:}
484 The @samp{epoch} and @samp{debian_revision} parts are optional.
501 If these parts are present, hyphen and/or colons can appear only once
507 As a result, in GNU Coreutils hyphens and colons are treated exactly
530 algorithm} and @uref{https://bugs.gnu.org/35939,GNU Bug 35939}.
536 special priority and sort before all other strings (listed in order):
563 files dot @samp{.} and dot-dot @samp{..} will be listed
568 because the sorting code is shared between the @command{ls} and @command{sort}
587 or tildes; all repeated zero or more times, and ending at string end.
594 The suffixes are temporarily removed, and the strings are compared
601 result is used and the suffixes are effectively ignored.
605 and the entire strings are compared using version sort.
645 @samp{.tar.gz} and @samp{.tar.xz} are temporarily removed from the
654 (@samp{.foobar65} and @samp{.foobar4}) are temporarily removed. The
656 restored, and the entire strings are compared (@samp{hello.foobar4} comes
664 When comparing the strings @samp{hello-8.2.txt} and @samp{hello-8.10.txt}, the
666 (@samp{hello-8.2} and @samp{hello-8.10}) are compared as previously described
674 Consider the comparison of hello-8.txt and hello-8.2.txt.
694 @file{hello-8.2.txt}, and this is where the suffix-removal comes into play:
696 The suffixes (@samp{.txt}) are removed, and the remaining strings are
711 and @file{gcc_10.8.12.7rc2.fc9.tar.bz2}: Debian's algorithm would list
719 because the sorting code is shared between the @command{ls} and @command{sort}
726 The Debian program @command{dpkg} (available on all Debian and Ubuntu
767 To illustrate the different handling of hyphens between Debian and
769 @ref{Hyphen-minus and colon}):
813 here, please write to @email{coreutils@@gnu.org}, and provide a
846 Perl has multiple packages for natural and version sorts
847 (each likely with its own rules and nuances):
868 strverscmp(3)} function to compare two strings, and