From a9c9b3a125259f0e58920ece8bdc38495e3e8c4b Mon Sep 17 00:00:00 2001 From: atatat Date: Wed, 2 Apr 2003 22:32:19 +0000 Subject: [PATCH] Use awk instead of fgrep and sed, and default to 80 if we get something that is arithmetically equal to 0. --- usr.sbin/etcupdate/etcupdate | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate b/usr.sbin/etcupdate/etcupdate index be215dafa20c..406bbc1811a5 100644 --- a/usr.sbin/etcupdate/etcupdate +++ b/usr.sbin/etcupdate/etcupdate @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: etcupdate,v 1.16 2003/04/02 16:30:25 perry Exp $ +# $NetBSD: etcupdate,v 1.17 2003/04/02 22:32:19 atatat Exp $ # # Copyright (c) 2001 The NetBSD Foundation, Inc. # All rights reserved. @@ -55,7 +55,7 @@ PATH="/sbin:/usr/sbin:/bin:/usr/bin:${PATH}" TEMPROOT="${TEMPROOT:=/tmp/temproot}" SRCDIR="${SRCDIR:=/usr/src/etc}" PAGER="${PAGER:=/usr/bin/more}" -SWIDTH=`stty -a | fgrep columns | sed -E 's/.+ ([0-9]+) columns.+/\1/'` +SWIDTH=`stty -a | awk '/columns/{w=$6}END{if(w==0){w=80}print w}'` WIDTH="${WIDTH:=${SWIDTH}}" VERBOSE= CONTINUE=