Module Name:    src
Committed By:   christos
Date:           Sun Sep 18 18:24:00 UTC 2016

Modified Files:
        src/distrib/atari/floppies/prepare: install.sh

Log Message:
Kill expr, modernize


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/atari/floppies/prepare/install.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/atari/floppies/prepare/install.sh
diff -u src/distrib/atari/floppies/prepare/install.sh:1.2 src/distrib/atari/floppies/prepare/install.sh:1.3
--- src/distrib/atari/floppies/prepare/install.sh:1.2	Wed Apr 30 09:10:48 2008
+++ src/distrib/atari/floppies/prepare/install.sh	Sun Sep 18 14:24:00 2016
@@ -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 @@ MODE="install"
 #	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

Reply via email to