summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd T. Fries <todd@cvs.openbsd.org>2005-10-12 13:11:56 +0000
committerTodd T. Fries <todd@cvs.openbsd.org>2005-10-12 13:11:56 +0000
commit9b817aac6ea785b85b6b4aaa9c8a60f611186fa0 (patch)
tree716300c68b8c88c466382573136eef2a82d51431
parent8e8f65ae18f71b8f13f6f715114c18495ae1371d (diff)
shrink stripcom(), sync with install.sub
ok krw@
-rw-r--r--etc/netstart16
1 files changed, 5 insertions, 11 deletions
diff --git a/etc/netstart b/etc/netstart
index cd14a36cf0d..397d6c551c7 100644
--- a/etc/netstart
+++ b/etc/netstart
@@ -1,20 +1,14 @@
#!/bin/sh -
#
-# $OpenBSD: netstart,v 1.107 2005/10/04 12:50:15 todd Exp $
+# $OpenBSD: netstart,v 1.108 2005/10/12 13:11:55 todd Exp $
# Strip comments (and leading/trailing whitespace if IFS is set)
# from a file and spew to stdout
stripcom() {
- local _file="$1"
- local _line
-
- {
- while read _line ; do
- _line=${_line%%#*} # strip comments
- test -z "$_line" && continue
- echo $_line
- done
- } < $_file
+ local _l
+ while read _l; do
+ [[ -n ${_l%%#*} ]] && echo $_l
+ done<$1
}
# Returns true if $1 contains only alphanumerics