On Thu, 15 Feb 2001, Giacomo Catenazzi wrote:
> How to use: (now, testing phase)
>   unpack the files (better: in a new directory)
>   > bash autoconfigure.sh | less
>   check the output.
>   no super user privileges required!
	Nice work - that's a neat way to do it.
	One detail; you appear to assume that bash2 is being used.  If
bash1 is /bin/bash, one gets syntax errors.  The following patch allows
the script to run under bash1 and bash2, with no noticeable problems.
--- autoconfigure.sh-0.9.1.2.orig	Wed Feb 14 15:37:30 2001
+++ autoconfigure.sh	Thu Feb 15 10:59:45 2001
@@ -109,7 +109,7 @@
 }
 function found () {
     local conf=CONFIG_$1
-    if [ "${!conf}" !=  "y" ]; then
+    if [ "${conf}" !=  "y" ]; then
 	define $1 y
     else
 	debug "$1=y"
@@ -117,7 +117,7 @@
 }
 function found_y () {
     local conf=CONFIG_$1
-    if [ "${!conf}" != "y" ]; then
+    if [ "${conf}" != "y" ]; then
 	define $1 y
     else
 	debug "$1=y"
@@ -125,7 +125,7 @@
 }
 function found_m () {
     local conf=CONFIG_$1
-    if [ "${!conf}" != "y"  -a  "${!1}" != "m" ]; then
+    if [ "${conf}" != "y"  -a  "${1}" != "m" ]; then
 	define $1 m
     else
 	debug "$1=m"
@@ -133,7 +133,7 @@
 }
 function found_n () {
     local conf=CONFIG_$1
-    if [ -z "${!conf}" ]; then
+    if [ -z "${conf}" ]; then
 	define $1 n
     else
 	debug "$1=n"
@@ -142,7 +142,7 @@
 }
 function provide () {
     local prov=PROVIDE_$1
-    if [ "${!prov}" !=  "y" ]; then
+    if [ "${prov}" !=  "y" ]; then
         eval "PROVIDE_$1=y"
 	debug "PROVIDE_$1"
     fi
@@ -188,7 +188,7 @@
     set `od -An -tx1 -v $f`
     x0=$1; shift   # make variables zero-based
     echo -n "${1}${x0},${3}${2}"
-    if [ "${14}" == "00" ]; then
+    if [ "${14}" = "00" ]; then
 	echo -n ",${45}${44},${47}${46}"
     fi
     echo ",${8};Class:${11}${10},${9}"
	I'm sure I'm missing the real reasons why the "${!" and "=="
syntaxes were used (I don't know what they do, as I stick to bash1 for
portability), so my apologies in advance.
	Cheers,
	- Bill
---------------------------------------------------------------------------
	"Mouse movement detected.  Please reboot for changes to take
effect."
--------------------------------------------------------------------------
William Stearns (wstearns@pobox.com).  Mason, Buildkernel, named2hosts,
and ipfwadm2ipchains are at:                http://www.pobox.com/~wstearns
LinuxMonth; articles for Linux Enthusiasts! http://www.linuxmonth.com
--------------------------------------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/