Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/sets Simplify (and no need for sub-shells).
details: https://anonhg.NetBSD.org/src/rev/22561d6c7246
branches: trunk
changeset: 349553:22561d6c7246
user: kre <kre%NetBSD.org@localhost>
date: Wed Dec 14 13:04:42 2016 +0000
description:
Simplify (and no need for sub-shells).
Same functionality, same method, simpler exposition.
diffstat:
distrib/sets/sort-list | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (15 lines):
diff -r 491308cee8bd -r 22561d6c7246 distrib/sets/sort-list
--- a/distrib/sets/sort-list Wed Dec 14 12:59:51 2016 +0000
+++ b/distrib/sets/sort-list Wed Dec 14 13:04:42 2016 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index