Source-Changes-HG archive

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

[src/trunk]: src/distrib/miniroot eXorcize and `` -> $()



details:   https://anonhg.NetBSD.org/src/rev/d928e8237965
branches:  trunk
changeset: 998001:d928e8237965
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Apr 04 20:51:35 2019 +0000

description:
eXorcize and `` -> $()

diffstat:

 distrib/miniroot/install.sh  |   36 +++++-----
 distrib/miniroot/install.sub |  132 +++++++++++++++++++++---------------------
 distrib/miniroot/upgrade.sh  |   24 +++---
 3 files changed, 96 insertions(+), 96 deletions(-)

diffs (truncated from 702 to 300 lines):

diff -r 6922c8663a9c -r d928e8237965 distrib/miniroot/install.sh
--- a/distrib/miniroot/install.sh       Thu Apr 04 20:39:17 2019 +0000
+++ b/distrib/miniroot/install.sh       Thu Apr 04 20:51:35 2019 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: install.sh,v 1.26 2018/09/16 21:32:29 kre Exp $
+#      $NetBSD: install.sh,v 1.27 2019/04/04 20:51:35 christos Exp $
 #
 # Copyright (c) 1996,1997,1999,2000,2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -64,8 +64,8 @@
 
 # we need to make sure .'s below work if this directory is not in $PATH
 # dirname may not be available but expr is
-Mydir=`expr $0 : '^\(.*\)/[^/]*$'`
-Mydir=`cd ${Mydir:-.}; pwd`
+Mydir=$(expr $0 : '^\(.*\)/[^/]*$')
+Mydir=$(cd ${Mydir:-.}; pwd)
 
 # this is the most likely place to find the binary sets
 # so save them having to type it in
@@ -114,7 +114,7 @@
 
 test "$md_view_labels_possible" && md_view_labels
 
-while [ "X${ROOTDISK}" = "X" ]; do
+while [ -z "${ROOTDISK}" ]; do
        getrootdisk
 done
 
@@ -144,8 +144,8 @@
 
 echo   "${ROOTDISK}a   /" > ${FILESYSTEMS}
 
-resp="X"       # force at least one iteration
-while [ "X$resp" != X"done" ]; do
+resp="not-done"        # force at least one iteration
+while [ "$resp" != "done" ]; do
        echo    ""
        echo -n "Device name? [RETURN if you already entered all devices] "
        getresp "done"
@@ -154,19 +154,19 @@
                ;;
 
        *)
-               _device_name=`basename $resp`
+               _device_name=$(basename $resp)
 
                # force at least one iteration
                _first_char="X"
-               while [ "X${_first_char}" != X"/" ]; do
+               while [ "${_first_char}" != "/" ]; do
                        echo -n "Mount point? "
                        getresp ""
                        _mount_point=$resp
-                       if [ "X${_mount_point}" = X"/" ]; then
+                       if [ "${_mount_point}" = "/" ]; then
                                # Invalid response; no multiple roots
                                _first_char="X"
                        else
-                               _first_char=`firstchar ${_mount_point}`
+                               _first_char=$(firstchar ${_mount_point})
                        fi
                done
                echo "${_device_name}   ${_mount_point}" >> ${FILESYSTEMS}
@@ -177,7 +177,7 @@
 
 # configure swap
 resp=""                # force at least one iteration
-while [ "X${resp}" = X"" ]; do
+while [ -z "${resp}" ]; do
        echo -n "Ok to configure ${ROOTDISK}b as a swap device? [] "
        getresp ""
        case "$resp" in
@@ -236,10 +236,10 @@
        y*|Y*)
                resp=""         # force at least one iteration
                if [ -f /etc/myname ]; then
-                       resp=`cat /etc/myname`
+                       resp=$(cat /etc/myname)
                fi
                echo -n "Enter system hostname: [$resp] "
-               while [ "X${resp}" = X"" ]; do
+               while [ -z "${resp}" ]; do
                        getresp "$resp"
                done
                hostname $resp
@@ -247,7 +247,7 @@
 
                echo -n "Enter DNS domain name: "
                getresp "none"
-               if [ "X${resp}" != X"none" ]; then
+               if [ "${resp:-none}" != "none" ]; then
                        FQDN=$resp
                fi
 
@@ -255,7 +255,7 @@
 
                echo -n "Enter IP address of default route: [none] "
                getresp "none"
-               if [ "X${resp}" != X"none" ]; then
+               if [ "${resp:-none}" != "none" ]; then
                        route delete default > /dev/null 2>&1
                        if route add default $resp > /dev/null ; then
                                echo $resp > /tmp/mygate
@@ -263,11 +263,11 @@
                fi
 
                resp="none"
-               if [ X${FQDN} != X ]; then
+               if [ -n "${FQDN}" ]; then
                        echo -n "Enter IP address of primary nameserver: [none] "
                        getresp "none"
                fi
-               if [ "X${resp}" != X"none" ]; then
+               if [ "${resp:-none}" != "none" ]; then
                        echo "domain $FQDN" > /tmp/resolv.conf
                        echo "nameserver $resp" >> /tmp/resolv.conf
                        echo "search $FQDN" >> /tmp/resolv.conf
@@ -427,7 +427,7 @@
                echo "No /dev/MAKEDEV installed, something is wrong here..."
        else
                echo -n "Making devices..."
-               pid=`twiddle`
+               pid=$(twiddle)
                cd /mnt/dev
                sh MAKEDEV all
                kill $pid
diff -r 6922c8663a9c -r d928e8237965 distrib/miniroot/install.sub
--- a/distrib/miniroot/install.sub      Thu Apr 04 20:39:17 2019 +0000
+++ b/distrib/miniroot/install.sub      Thu Apr 04 20:51:35 2019 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: install.sub,v 1.46 2017/08/15 09:49:38 mlelstv Exp $
+#      $NetBSD: install.sub,v 1.47 2019/04/04 20:51:35 christos Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -53,7 +53,7 @@
 
 getresp() {
        read resp
-       if [ "X$resp" = "X" ]; then
+       if [ -z "$resp" ]; then
                resp=$1
        fi
 }
@@ -243,7 +243,7 @@
 Available disks are:
 
 __getrootdisk_1
-       _DKDEVS=`md_get_diskdevs`
+       _DKDEVS=$(md_get_diskdevs)
        echo    "$_DKDEVS"
        echo    ""
        echo -n "Which disk is the root disk? "
@@ -323,16 +323,16 @@
        local _ifsdone
        local _ifs
 
-#      _IFS=`md_get_ifdevs`
-       _IFS=`ifconfig -l | sed '
+#      _IFS=$(md_get_ifdevs)
+       _IFS=$(ifconfig -l | sed '
                s/lo0//
                s/ppp[0-9]//g
                s/sl[0-9]//g
-               s/tun[0-9]//g'`
+               s/tun[0-9]//g')
 
        _ifsdone=""
        resp=""         # force at least one iteration
-       while [ "X${resp}" != X"done" ]; do
+       while [ "${resp}" != "done" ]; do
        cat << \__configurenetwork_1
 
 You may configure the following network interfaces (the interfaces
@@ -383,37 +383,37 @@
 
        _interface_name=$1
        _up=DOWN
-       if isin $_interface_name `ifconfig -l -u` ; then
+       if isin $_interface_name $(ifconfig -l -u); then
                _up=UP
        fi
 
-       _interface_supported_media=`ifconfig -m $_interface_name | sed -n '
+       _interface_supported_media=$(ifconfig -m $_interface_name | sed -n '
                /^[     ]*media autoselect/d
-               4,$s/[  ]*media //p'`
+               4,$s/[  ]*media //p')
 
        # get current "media" "ip" and "netmask" ("broadcast")
-       _t=`ifconfig $_interface_name | sed -n '
-               s/^[    ]*media: [^     ]* \([^ ][^ ]*\).*/\1/p'`
+       _t=$(ifconfig $_interface_name | sed -n '
+               s/^[    ]*media: [^     ]* \([^ ][^ ]*\).*/\1/p')
 
-       if [ "$_t" != "manual" -a "$_t" != "media:" -a "$_t" != "autoselect" ];
+       if [ "$_t" != "manual" ] && [ "$_t" != "media:" ] && [ "$_t" != "autoselect" ];
        then
                _interface_mediumtype=$1
        fi
 
-       set -- `ifconfig $_interface_name | sed -n '
+       set -- $(ifconfig $_interface_name | sed -n '
                /^[     ]*inet/{
                s/inet//
                s/--> [0-9.][0-9.]*//
                s/netmask//
                s/broadcast//
-               p;}'`
+               p;}')
 
        _interface_ip=$1
        _interface_mask=$2
 
        # Get IP address
        resp=""         # force one iteration
-       while [ "X${resp}" = X"" ]; do
+       while [ -z "${resp}" ]; do
                echo -n "IP address? [$_interface_ip] "
                getresp "$_interface_ip"
                _interface_ip=$resp
@@ -421,7 +421,7 @@
 
        # Get symbolic name
        resp=""         # force one iteration
-       while [ "X${resp}" = X"" ]; do
+       while [ -z "${resp}" ]; do
                echo -n "Symbolic (host) name? "
                getresp ""
                _interface_symname=$resp
@@ -429,7 +429,7 @@
 
        # Get netmask
        resp=""         # force one iteration
-       while [ "X${resp}" = X"" ]; do
+       while [ -n "${resp}" ]; do
                echo -n "Netmask? [$_interface_mask] "
                getresp "$_interface_mask"
                _interface_mask=$resp
@@ -441,19 +441,19 @@
        echo -n "Additional media type arguments (none)? [$_interface_mediumtype] "
        getresp "$_interface_mediumtype"
        _m=""
-       if [ "X${resp}" != X"" -a "X${resp}" != Xnone ]; then
+       if [ "${resp:-none}" != "none" ]; then
                _interface_mediumtype=$resp
                _m="media ${resp}"
        fi
 
 
        echo "Your network interface might require additional link-layer"
-       echo "directives (like \`link0'). If this is the case you can enter"
+       echo "directives (like 'link0'). If this is the case you can enter"
        echo "these at the next prompt."
        echo ""
        echo -n "Additional link-layer arguments (none)? [$_interface_extra] "
        getresp "$_interface_extra"
-       if [ "X${resp}" != X"" -a "X${resp}" != Xnone ]; then
+       if [ "${resp:-none}" != "none" ]; then
                _interface_extra=$resp
        fi
 
@@ -494,9 +494,9 @@
 
        # Set up the hostname.
        if [ -f /mnt/etc/myname ]; then
-               hostname=`cat /mnt/etc/myname`
+               hostname=$(cat /mnt/etc/myname)
        elif [ -f /mnt/etc/rc.conf ];then
-               hostname=`sh -c '. /mnt/etc/rc.conf ; echo $hostname'`
+               hostname=$(sh -c '. /mnt/etc/rc.conf ; echo $hostname')
        else
                echo "ERROR: no /etc/myname!"
                return 1
@@ -518,13 +518,13 @@
 
        if [ "$net_interfaces" != NO ]; then
                if [ "$auto_ifconfig" = YES ]; then
-                       tmp="`ifconfig -l`"
+                       tmp="$(ifconfig -l)"
                else
                        tmp="$net_interfaces"
                fi
                echo -n "configuring network interfaces:"
                for i in $tmp; do
-                       eval `echo 'args=$ifconfig_'$i`
+                       eval $(echo 'args=$ifconfig_'$i)
                        if [ ! -z "$args" ]; then
                                echo -n " $i"
                                ifconfig $i $args
@@ -547,7 +547,7 @@
 (
        tmp="$IFS"
        IFS="$IFS."
-       set -- `echo /mnt/etc/hostname*`
+       set -- $(echo /mnt/etc/hostname*)
        IFS=$tmp



Home | Main Index | Thread Index | Old Index