]> git.plutz.net Git - serve0/commitdiff
put negations at end in title listing
authorpaul <paul@plutz.net>
Tue, 15 Mar 2016 10:57:20 +0000 (10:57 +0000)
committerpaul <paul@plutz.net>
Tue, 15 Mar 2016 10:57:20 +0000 (10:57 +0000)
svn path=/trunk/; revision=111

pages/list.sh

index 39a6ccbea7e64855400e61ca81833aedfd8fa3f2..eddbb8c63c87cea04ba220dd5a32d8c9e1e7bfe2 100755 (executable)
@@ -24,7 +24,12 @@ LF='
 filters="${_GET[f]}"
 debug "FILTERS: $filters"
 
-present_filter(){ printf %s "$*" |sed -r 's;(^|!|\^|\|)([^!\^\|:]+:);\1;g;s;\^; \&amp\; ;g' }
+present_filter(){
+  printf %s\\n "$*" \
+  | sed -r 's;(^|!|\^|\|)([^!\^\|:]+:);\1;g;s;\^;\n;g' \
+  | sort -r \
+  | sed -r '$q;s;$; \&amp\; ;g'
+}
 
 if [ -n "$search" ]; then
   TITLE="$search by $order"