From owner-svn-doc-all@FreeBSD.ORG Thu Apr 2 01:30:09 2015 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA940549; Thu, 2 Apr 2015 01:30:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C13AA2D; Thu, 2 Apr 2015 01:30:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t321U9sm031763; Thu, 2 Apr 2015 01:30:09 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t321U9m1031759; Thu, 2 Apr 2015 01:30:09 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201504020130.t321U9m1031759@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 2 Apr 2015 01:30:09 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r46422 - head/share/examples X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2015 01:30:09 -0000 Author: eadler Date: Thu Apr 2 01:30:08 2015 New Revision: 46422 URL: https://svnweb.freebsd.org/changeset/doc/46422 Log: doc/share/examples: slight modernization - stop using the 'X' trick - use more quotes Modified: head/share/examples/add-manref.sh head/share/examples/check-manref.sh Modified: head/share/examples/add-manref.sh ============================================================================== --- head/share/examples/add-manref.sh Wed Apr 1 22:23:09 2015 (r46421) +++ head/share/examples/add-manref.sh Thu Apr 2 01:30:08 2015 (r46422) @@ -28,7 +28,7 @@ word_on_line () { sed -E 's/^[[:digit:]]*:<\\!ENTITY man[.]([-[:alnum:].]*)[.][[:digit:]]* \".*$$/\1/'`; } -if [ X$3 = X ]; then +if [ -z "$3" ]; then echo "usage: $0 file name section"; exit 2; fi @@ -40,14 +40,14 @@ k=`echo $n | sed 's/_/./g'`; firstline=`grep -n "^<\\!ENTITY man[.][-[:alnum:].]*[.]$s \"" $i | \ head -1 | cut -d: -f1`; -if [ "X$firstline" = "X" ]; then +if [ -z "$firstline" ]; then echo "Can't find first line of section $s."; exit 2; fi echo "First line of section $s is $firstline."; lastline=`grep -n "^<\\!ENTITY man[.][-[:alnum:].]*[.]$s \"" $i | \ tail -1 | cut -d: -f1`; -if [ "X$lastline" = "X" ]; then +if [ -z "$lastline" ]; then echo "Can't find last line of section $s."; exit 2; fi Modified: head/share/examples/check-manref.sh ============================================================================== --- head/share/examples/check-manref.sh Wed Apr 1 22:23:09 2015 (r46421) +++ head/share/examples/check-manref.sh Thu Apr 2 01:30:08 2015 (r46422) @@ -28,7 +28,7 @@ word_on_line () { sed -E 's/^[[:digit:]]*:<\\!ENTITY man[.]([-[:alnum:].]*)[.][[:digit:]]* \".*$$/\1/'`; } -if [ X$2 = X ]; then +if [ -z "$2" ]; then echo "usage: $0 file section"; exit 2; fi @@ -38,21 +38,21 @@ s=$2; firstline=`grep -n "^<\\!ENTITY man[.][-[:alnum:].]*[.]$s \"" $i | \ head -1 | cut -d: -f1`; -if [ "X$firstline" = "X" ]; then +if [ -z "$firstline" ]; then echo "Can't find first line of section $s."; exit 2; fi echo "First line of section $s is $firstline."; lastline=`grep -n "^<\\!ENTITY man[.][-[:alnum:].]*[.]$s \"" $i | \ tail -1 | cut -d: -f1`; -if [ "X$lastline" = "X" ]; then +if [ -z "$lastline" ]; then echo "Can't find last line of section $s."; exit 2; fi echo "Last line of section $s is $lastline."; -x=$firstline; -while [ $x != $lastline ]; do +x="$firstline"; +while [ "$x" != "$lastline" ]; do wol_l=$x; word_on_line; if [ "$last" ]; then