Hi,

I've started hacking libbash and xconfig to make both scripts compatible
with bash 2 and older coreutils (I'm stuck to a Red Hat 7.3 environment)
Please review my patches attached to this mail.
I think it would be a good idea to use autoconf / automake to detect the
bash version and generate the scripts with appropriate code. Could
someone please give me some hints about this?

Thanks in advance,
Dick
--- xconfig.in	2006-06-26 18:15:30.000000000 +0200
+++ /home/meeuw/xconfig	2006-08-14 17:34:35.000000000 +0200
@@ -180,7 +180,7 @@
 	echo "Available video devices:"
 	# This gets the names of the devices from lspci (using awk), Gives them numbers (using grep),
 	# and adds a tab in the begining of each line of the result (using sed).
-	 lspci | grep VGA | awk -F: '{print "\t"$3}' | grep -n . | sed 's/^/\t/g'
+	 lspci | grep VGA | awk -F: '{print "\t"$3}' | grep -n . | sed 's/^/	/g'
 	 exit 0
 fi
 
@@ -204,12 +204,13 @@
 		exit_status=$?
 		
 		# Fix the indentation
-		sed -i -e 's/^ *\t */\t/g' -e 's/^ //g' $CONF_FILE
+		sed -e 's/^ *	 */	/g' -e 's/^ //g' $CONF_FILE > ${CONF_FILE}.$$
+		mv -f ${CONF_FILE}.$$ ${CONF_FILE}
 		exit $exit_status
 	else
 		# List available plugins
 		echo "Available change options:"
-		ls $PLUGINS_DIR | grep "\.sh"$ | sed -e 's/\.sh$//g' -e 's/^/\t/g' 2> /dev/null || echo "\t No change options available."
+		ls $PLUGINS_DIR | grep "\.sh"$ | sed -e 's/\.sh$//g' -e 's/^/	/g' 2> /dev/null || echo "\t No change options available."
 		exit 0
 	fi
 fi
@@ -308,7 +309,8 @@
 fi
 
 # Fix indentation
-sed -i -e 's/^ *\t */\t/g' -e 's/^ //g' $CONF_FILE
+sed -e 's/^ *	 */	/g' -e 's/^ //g' $CONF_FILE > ${CONF_FILE}.$$
+mv ${CONF_FILE}.$$ ${CONF_FILE}
 
 # Remove the temporary modules file
 rm -f $EXTRA_MODULES_FILE
--- getopts.sh	2006-05-08 14:26:18.000000000 +0200
+++ /home/meeuw/getopts.sh	2006-08-14 17:29:11.000000000 +0200
@@ -138,7 +138,7 @@
 			
 			# Replace the multi letter parameter that has `=' after it with a single letter parameter
 			# that has a ` ' after it.
-			curr_param="$(sed -e "s/^$MultiLetterName\(=\|\)/ $SingleLetterName /g" <<< $curr_param)"
+			curr_param="$(echo $curr_param|sed -e "s/^$MultiLetterName\(=\|\)/ $SingleLetterName /g")"
 		done
 		ParsedParams="$ParsedParams $curr_param"
 	done
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Xconfig-common mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xconfig-common

Reply via email to