From: Roy Marples Date: Wed, 1 Jun 2011 06:28:41 +0000 (+0000) Subject: Shell portability fixes X-Git-Tag: v5.5.0~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cbb26a03b2a3912537a1c6c77c3e05c79ca6820;p=thirdparty%2Fdhcpcd.git Shell portability fixes --- diff --git a/configure b/configure index 6b464a17..8a395fef 100755 --- a/configure +++ b/configure @@ -15,7 +15,7 @@ DEBUG= FORK= INCLUDEDIR= -for x; do +for x do opt=${x%%=*} var=${x#*=} case "$opt" in diff --git a/dhcpcd-hooks/20-resolv.conf b/dhcpcd-hooks/20-resolv.conf index 984dae69..85f388cd 100644 --- a/dhcpcd-hooks/20-resolv.conf +++ b/dhcpcd-hooks/20-resolv.conf @@ -31,7 +31,7 @@ build_resolv_conf() set -- ${domain} unset domain if [ -n "$2" ]; then - search="$search $@" + search="$search $*" elif [ -n "$1" ]; then domain="domain $1\n" fi @@ -88,7 +88,7 @@ add_resolv_conf() fi # Support RFC violating search in domain if [ -z "$new_domain_search" -a -n "$2" ]; then - new_domain_search="$@" + new_domain_search="$*" fi fi if [ -n "$new_domain_search" ]; then diff --git a/dhcpcd-run-hooks.in b/dhcpcd-run-hooks.in index 11d29fb7..0e603381 100644 --- a/dhcpcd-run-hooks.in +++ b/dhcpcd-run-hooks.in @@ -20,7 +20,7 @@ esac uniqify() { local result= i= - for i; do + for i do case " $result " in *" $i "*);; *) result="$result $i";; @@ -62,7 +62,7 @@ key_get_value() if type sed >/dev/null 2>&1; then sed -n "s/^$key//p" $@ else - for x; do + for x do while read line; do case "$line" in "$key"*) echo "${line##$key}";; @@ -82,7 +82,7 @@ remove_markers() if type sed >/dev/null 2>&1; then sed "/^$m1/,/^$m2/d" $@ else - for x; do + for x do while read line; do case "$line" in "$m1"*) in_marker=1;; @@ -172,7 +172,7 @@ valid_domainname_list() { local name - for name in $@; do + for name do valid_domainname "$name" || return $? done return 0