Put
set -xv
as your second line. You can now see what is happening as it executes. A clue -
plus $i
doesn't do what you think it does.
shibblez
Junior Poster in Training
72 posts since Oct 2010
Reputation Points: 15
Solved Threads: 6
There are many shells. Which one are you using?
The normal meaning for PLUS parameters is" Return the sum of all the parameters", so the recursive way would be to return PLUS (first+second) rest of the parameters
Or calculate (i, i+1) for i in the proper range and return PLUS pair-sums
Or something that does part of the work now and defers some of the work to a call of itself.
griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256