root/trunk/bin/sort_ci
1 |
#!/bin/sh
|
---|---|
2 |
# Sorts a spreadsheet, ignoring leading punctuation
|
3 |
|
4 |
selfDir="$(dirname -- "$0")" |
5 |
|
6 |
sedEreFlag="$(test "$(uname)" = Darwin && echo E || echo r)" |
7 |
|
8 |
sed () { "$(which sed)" -"$sedEreFlag" "$@";} |
9 |
|
10 |
sed 's/^[[:punct:]]*(.*)$/\1,&/'|"$selfDir/sort" 0|"$selfDir/cols" 1|uniq |