Module Name: src
Committed By: rillig
Date: Fri Sep 4 12:02:20 UTC 2020
Modified Files:
src/distrib/sets: sort-list
Log Message:
sort file lists with error checking, use lowercase variable name
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.2 src/distrib/sets/sort-list:1.3
--- src/distrib/sets/sort-list:1.2 Wed Dec 14 13:04:42 2016
+++ src/distrib/sets/sort-list Fri Sep 4 12:02:20 2020
@@ -1,7 +1,9 @@
#!/bin/sh
+set -eu
-for F
-do
- { grep '^#' "${F}"; grep -v '^#' "${F}" | LC_ALL=C sort ;} > "${F}".tmp
- mv "${F}".tmp "${F}"
+for fname; do
+ { grep '^#' "$fname"
+ grep -v '^#' "$fname" | LC_ALL=C sort
+ } > "$fname.tmp"
+ mv "$fname.tmp" "$fname"
done