Added sorting to all profile listing so that --list displays a sorted
list of profile names.
Notice strange IFS and local behaviour when IFS is declared as local.