Source-Changes-HG archive

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

[src/trunk]: src/distrib/atari/floppies/prepare Kill expr, modernize



details:   https://anonhg.NetBSD.org/src/rev/64aac7d2c070
branches:  trunk
changeset: 347850:64aac7d2c070
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Sep 18 18:24:00 2016 +0000

description:
Kill expr, modernize

diffstat:

 distrib/atari/floppies/prepare/install.sh |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (45 lines):

diff -r 67c9c139800a -r 64aac7d2c070 distrib/atari/floppies/prepare/install.sh
--- a/distrib/atari/floppies/prepare/install.sh Sun Sep 18 17:03:12 2016 +0000
+++ b/distrib/atari/floppies/prepare/install.sh Sun Sep 18 18:24:00 2016 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: install.sh,v 1.2 2008/04/30 13:10:48 martin Exp $
+#      $NetBSD: install.sh,v 1.3 2016/09/18 18:24:00 christos Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -44,25 +44,28 @@
 #      md_makerootwritable()   - make root writable (at least /tmp)
 
 # 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`
+case $0 in
+*/*)   Mydir=${0%/*};;
+*)     Mydir=.;;
+esac
+Mydir=$(cd "${Mydir}" && pwd)
 
 #
 # Sub-parts
 #
 getresp() {
        read resp
-       if [ "X$resp" = "X" ]; then
+       if [ -z "$resp" ]; then
                resp=$1
        fi
 }
 
 isin() {
 # test the first argument against the remaining ones, return succes on a match
-       _a=$1; shift
+       local a=$1
+       shift
        while [ $# != 0 ]; do
-               if [ "$_a" = "$1" ]; then return 0; fi
+               if [ "$a" = "$1" ]; then return 0; fi
                shift
        done
        return 1



Home | Main Index | Thread Index | Old Index