About 155,000 results
Open links in new tab
  1. How to sort an array in Bash - Stack Overflow

    Jul 9, 2015 · Kudos for impressive Bashing that offers great flexibility with respect to input elements and sort criteria. If line-based sorting with the sort options that sort offers is sufficient, …

  2. arrays - sorting in shell script - Stack Overflow

    Oct 23, 2015 · I have an array arr=( x11 y12 x21 y22 x31 y32) I need to sort this array to x11 x21 x31 y12 y22 y32 So, I need to sort both alphabetical and numerical wise How do I perform this …

  3. sorting - using sort command in shell scripting - Stack Overflow

    Jul 12, 2012 · (I retrieve the values of edate1 and etime1 from my database and store it in an array which works fine.) I receive the o/p as: 97 16 97 16 97 12 107 16 97 16 97 16 97 16 97 …

  4. How can I sort array in bash? - Stack Overflow

    for example, if I want to write a script that get strings as arguments, and I want to insert them to array array_of_args and then I want to sort this array and to make sorting array. How can I do …

  5. Bash - Sort a list of strings - Stack Overflow

    Feb 27, 2018 · Would you please show me know how I can sort the following list (ascending oder A to Z) (or a list in general) with Bash? I have been trying but still could not get the expected …

  6. How do I create an array in Unix shell scripting?

    Dec 10, 2009 · The shell supports one-dimensional arrays. The maximum number of array elements is 1,024. When an array is defined, it is automatically dimensioned to 1,024 …

  7. shell - How to sort string array in descending order in Bash?

    Jul 9, 2024 · the printf '%s\n' ${arr[@]} is just a good reminder that it will process all values one-by-one from the input string, replacing a for loop for (in this case), the same functionality.

  8. How to sort arrays in Bash - Stack Overflow

    Dec 28, 2013 · The following script sorts array a where first element in the array is the number of elements in the array. The result is stored in variable b #! /bin/bash IFS=$'\n' a=( 3 3 2 1 ) …

  9. How can I sort the string array in linux bash shell?

    Jun 17, 2015 · i do not know bash's inner handling of the IFS when printing an array. @ or * expand to all entries in an array. you might want to access or print the values contained by …

  10. How can I get unique values from an array in Bash?

    Nov 30, 2012 · "${ids[@]}" - Syntax for working with shell arrays, whether used as part of echo or a herestring. The @ part means "all elements in the array" tr ' ' '\n' - Convert all spaces to …

Refresh