Added a bash sort function.

[ADDED]     A sort function for use from bash scripts that takes a comparator.