core/qsort

Pure Bash QSort Support

Dependency Graph

core/qsort: Library Dependencies

View color source code (raw) for this file

View reStructuredText (rst) source code for this page

Library Configuration

$qsort_compare_func

Name of function to use for comparing two items. See the Comparison Functions section for more information and built-in options.

Internal functions

Public interface

qsort()

Sorts items ($@) into the named array ($1) using the original qsort algorithm.

$1 - Array to receive sorted items

$@ - Items to sort

qsort_list()

Sorts the named list ($1) in place using qsort().

Comparison Functions

The functions in this section are meant to be used as $qsort_compare_func. They each take two arguments:

$1 - First item to compare

$2 - Second item to compare

Returns: Success if the two items are in the correct order.

compare_str_asc()

Sorts strings in ascending order

compare_str_asc()

Sorts strings in descending order

compare_int_asc()

Sorts integers in ascending order

compare_int_dsc()

Sorts integers in descending order

compare_int_asc()

Sorts files by modification time in chronological order.

compare_int_dsc()

Sorts files by modification timein reverse chronological order .


View the Developer Guide Index

View the Reference Manual Index


Generated on Fri Jul 28 14:37:18 PDT 2017 by mcsh d14 v0.23.0.