Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/miniroot test ! -n "$foo" is just a quaint way of ...



details:   https://anonhg.NetBSD.org/src/rev/720942ed1065
branches:  trunk
changeset: 467271:720942ed1065
user:      kre <kre%NetBSD.org@localhost>
date:      Sun Jan 19 00:57:00 2020 +0000

description:
test ! -n "$foo"   is just a quaint way of saying test -z "$foo"
and test ! -z "$foo" is really just test -n "$foo"  so let's just
use the simple (and more obvious) forms.

NFCI.

diffstat:

 distrib/miniroot/install.sub |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 720dc6bf2139 -r 720942ed1065 distrib/miniroot/install.sub
--- a/distrib/miniroot/install.sub      Sun Jan 19 00:50:25 2020 +0000
+++ b/distrib/miniroot/install.sub      Sun Jan 19 00:57:00 2020 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: install.sub,v 1.52 2020/01/19 00:50:25 kre Exp $
+#      $NetBSD: install.sub,v 1.53 2020/01/19 00:57:00 kre Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -523,7 +523,7 @@
                echo -n "configuring network interfaces:"
                for i in $tmp; do
                        eval $(echo 'args=$ifconfig_'$i)
-                       if [ ! -z "$args" ]; then
+                       if [ -n "$args" ]; then
                                echo -n " $i"
                                ifconfig $i $args
                        elif [ -f /mnt/etc/ifconfig.$i ]; then
@@ -555,7 +555,7 @@
                        read af name mask bcaddr extras
                        read dt dtaddr
 
-                       if [ ! -n "$name" ]; then
+                       if [ -z "$name" ]; then
                    echo "/etc/hostname.$1: invalid network configuration file"
                                exit
                        fi
@@ -1047,7 +1047,7 @@
 __mount_a_disk_2
        _md_fstype=$(md_native_fstype)
        _md_fsopts=$(md_native_fsopts)
-       if [ ! -z "$_md_fstype" ]; then
+       if [ -n "$_md_fstype" ]; then
                echo "  3) $_md_fstype"
        else
                _md_fstype="_undefined_"



Home | Main Index | Thread Index | Old Index