Module Name: src
Committed By: kre
Date: Wed Dec 14 13:04:42 UTC 2016
Modified Files:
src/distrib/sets: sort-list
Log Message:
Simplify (and no need for sub-shells).
Same functionality, same method, simpler exposition.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/sets/sort-list
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/sort-list
diff -u src/distrib/sets/sort-list:1.1 src/distrib/sets/sort-list:1.2
--- src/distrib/sets/sort-list:1.1 Sun Aug 11 22:33:09 2013
+++ src/distrib/sets/sort-list Wed Dec 14 13:04:42 2016
@@ -1,7 +1,7 @@
#!/bin/sh
-while [ $# != 0 ]; do
- ( grep '^#' $1; grep -v '^#' $1 | LC_ALL=C sort ) > $1.tmp
- mv $1.tmp $1
- shift
+for F
+do
+ { grep '^#' "${F}"; grep -v '^#' "${F}" | LC_ALL=C sort ;} > "${F}".tmp
+ mv "${F}".tmp "${F}"
done