Wed Dec 14 13:04:42 2016 UTC ()
Simplify (and no need for sub-shells).
Same functionality, same method, simpler exposition.


(kre)
diff -r1.1 -r1.2 src/distrib/sets/sort-list

cvs diff -r1.1 -r1.2 src/distrib/sets/sort-list (expand / switch to unified diff)

--- src/distrib/sets/sort-list 2013/08/11 22:33:09 1.1
+++ src/distrib/sets/sort-list 2016/12/14 13:04:42 1.2
@@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2 2
3while [ $# != 0 ]; do 3for F
4 ( grep '^#' $1; grep -v '^#' $1 | LC_ALL=C sort ) > $1.tmp 4do
5 mv $1.tmp $1 5 { grep '^#' "${F}"; grep -v '^#' "${F}" | LC_ALL=C sort ;} > "${F}".tmp
6 shift 6 mv "${F}".tmp "${F}"
7done 7done