Optional parameters: Difference between revisions
Content added Content deleted
(Added Unix Shell (bash) implementation) |
m (→{{header|Unix Shell}}: simplified output code) |
||
Line 2,284: | Line 2,284: | ||
{{works with|bash|4.2}} |
{{works with|bash|4.2}} |
||
<lang bash>#!/usr/bin/env bash |
<lang bash>#!/usr/bin/env bash |
||
# sort-args |
# sort-args.sh |
||
data() { |
data() { |
||
Line 2,313: | Line 2,313: | ||
} |
} |
||
echo sort defaults ; data | sort_table |
|||
echo sort defaults reverse ; data | sort_table reverse |
|||
echo sort column 2 ; data | sort_table col 2 |
|||
echo sort column 2 reverse ; data | sort_table col 2 reverse |
|||
echo sort numeric ; data | sort_table numeric |
|||
echo sort numeric reverse ; data | sort_table numeric reverse |
|||
</lang> |
</lang> |
||
{{out}} |
{{out}} |