aboutsummaryrefslogtreecommitdiff
path: root/net/smm++/files/patch-itk.sh
blob: 969ed2e4e2538981172927b74d05dfe758d9dd58 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- ../../smm5r0/Install.unix/itk.sh	Mon Mar 19 08:46:07 2001
+++ itk.sh	Sun Jul 15 17:01:08 2001
@@ -1,32 +1,16 @@
 #!/bin/sh
 
 # all possible itkwish executables
-itkarray=(itkwish3.1 itkwish3 itkwish30 itkwish)
+itkarray="itkwish3.1 itkwish3 itkwish30 itkwish3.0 itkwish wish8.3 wish8.2"
 
-# $PATH exploded as an array
-explode=(`echo $PATH | sed 's/:/ /g'`)
-
-element_count=${#explode[@]}
-i=0
-found=0
-while [ $i -lt ${element_count} ]
-do
-    second_count=${#itkarray[@]}
-    x=0
-    while [ $x -lt ${second_count} ]
-    do
-        if [ -x ${explode[$i]}/${itkarray[$x]} ]; then
-            smm=${explode[$i]}/${itkarray[$x]}
-	    found=1
-            break
-        fi
-        let "x=$x + 1"
-    done
-    let "i = $i + 1"
+set $itkarray
+while [ ! -z "$1" ]; do
+	smm=`which $1`
+	if [ $? -eq 0 ]; then
+		echo ${smm}
+		exit 0
+	fi
+	shift
 done
-if [ ${found} -eq 1 ] ; then
-    echo ${smm}
-    exit 0
-else
-    exit 1
-fi
+
+exit 1