Hi folks,
I'm having trouble with a little shell script. Can somebody explain me why I 
get 3 times "expr: syntax  error" in my console after I run this little script?

#! /usr/local/bin/bash
# testscript 

var1="trees.J48" #other value will be rules.Jrip, rules.DecisionTable
len=${#var1}
ind=`expr index $var1 s`
pos=`expr $len - $ind`
out=`expr substr $var1 $ind $pos` 

I would expect (and want the following to happen):

$ind should contain 6
$pos should contain 3
$out should contain J48 (other values will have to be Jrip,DecisionTable)

Can anyone help me with this?

Thanks

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to