From b408cf70af32a23dc751c3b958b5e64eefffc61c Mon Sep 17 00:00:00 2001 From: todd <> Date: Wed, 12 Oct 2005 13:11:55 +0000 Subject: [PATCH] shrink stripcom(), sync with install.sub ok krw@ --- src/etc/netstart | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/etc/netstart b/src/etc/netstart index cd14a36c..397d6c55 100644 --- a/src/etc/netstart +++ b/src/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