Template:egSortString

From RaySoft

Syntax

{{egSortString}}

Usage

Code

{{egSortString}}

Result

Sort a comma separated string ignoring the first char
sed 's/\n//g; s/, */\n/g' <<<'.foo, #bar, -bla' \
| sort --key='1.2' \
| awk '{printf("%s%s", sep, $0); sep=", "} END {print ""}'

Output:

#bar, -bla, .foo