SVN: rc-scripts/trunk: backtick-test.sh rc.d/init.d/network

gotar gotar at pld-linux.org
Mon Oct 13 15:21:13 CEST 2008


Author: gotar
Date: Mon Oct 13 15:21:12 2008
New Revision: 9909

Added:
   rc-scripts/trunk/backtick-test.sh   (contents, props changed)
Modified:
   rc-scripts/trunk/rc.d/init.d/network
Log:
- restored some backticks - pdksh has broken $(...) closing paren detection,
- added backtick-test.sh to test whenever this would be valid some day


Added: rc-scripts/trunk/backtick-test.sh
==============================================================================
--- (empty file)
+++ rc-scripts/trunk/backtick-test.sh	Mon Oct 13 15:21:12 2008
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# from man sh:
+
+# NOTE:  $(command)  expressions are currently parsed by finding the matching paren-
+# thesis, regardless of quoting.  This will hopefully be fixed soon.
+
+# this script file will finally tell when 'soon' comes
+
+a=1
+
+ret_old=`
+case $a in
+	0)	echo "a=0";;
+	1)	echo "a=1";;
+	*)	echo "a!=[01]";;
+esac
+`
+
+ret_new=$(
+case $a in
+	0)	echo "a=0";;
+	1)	echo "a=1";;
+	*)	echo "a!=[01]";;
+esac
+)
+
+echo "$ret_old vs $ret_new"
\ No newline at end of file

Modified: rc-scripts/trunk/rc.d/init.d/network
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/network	(original)
+++ rc-scripts/trunk/rc.d/init.d/network	Mon Oct 13 15:21:12 2008
@@ -129,7 +129,7 @@
 
 	if [ -n "$bootprio" ]; then
 		# find all the interfaces besides loopback.
-		interfaces_boot=$(
+		interfaces_boot=`
 			for a in $(echo "$bootprio" | sort -t= -n -k2,2); do
 				i="${a%:BOOTPRIO*}"
 				case $i in
@@ -138,9 +138,9 @@
 				ONBOOT=""; . "$i" 2>/dev/null
 				[ ${ONBOOT:-no} = yes ] && echo "${i##*/ifcfg-}"
 			done
-		)
+		`
 	else
-		interfaces_boot=$(
+		interfaces_boot=`
 			for i in $ifcfg_files; do
 				case ${i##*/} in
 					ifcfg-lo|ifcfg-sit*|ifcfg-atm*|ifcfg-lec*|ifcfg-nas*|ifcfg-br*|ifcfg-*.*) continue ;;
@@ -148,9 +148,9 @@
 				ONBOOT=""; . "$i" 2>/dev/null
 				[ ${ONBOOT:-no} = yes ] && echo "${i##*/ifcfg-}"
 			done
-		)
+		`
 
-		interfaces_vlan_boot=$(
+		interfaces_vlan_boot=`
 			for i in $ifcfg_files; do
 				case ${i##*/} in
 					ifcfg-*.*) ;;
@@ -159,9 +159,9 @@
 				ONBOOT=""; . "$i" 2>/dev/null
 				[ ${ONBOOT:-no} = yes ] && echo "${i##*/ifcfg-}"
 			done
-		)
+		`
 
-		interfaces_br_boot=$(
+		interfaces_br_boot=`
 			for i in $ifcfg_files; do
 				case ${i##*/} in
 					ifcfg-br*) ;;
@@ -170,9 +170,9 @@
 				ONBOOT=""; . "$i" 2>/dev/null
 				[ ${ONBOOT:-no} = yes ] && echo "${i##*/ifcfg-}"
 			done
-		)
+		`
 
-		interfaces_sit_boot=$(
+		interfaces_sit_boot=`
 			for i in $ifcfg_files; do
 				case ${i##*/} in
 					ifcfg-sit*) ;;
@@ -181,7 +181,7 @@
 				ONBOOT=""; . "$i" 2>/dev/null
 				[ ${ONBOOT:-no} = yes ] && echo "${i##*/ifcfg-}"
 			done
-		)
+		`
 	fi
 
 	tunnels=$(


More information about the pld-cvs-commit mailing list