bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

recursion crash


From: Alex Turner
Subject: recursion crash
Date: Mon, 29 Oct 2001 14:11:19 -0000

Hi!

I am writing functional programming in BASH.  Which is really fun and very powerful - but I have hit a problem with recursion.

#!/usr/bin/bash
declare -i n
n=0
r()
{
   echo $n
   n=n+1
   r
}
r

The above script will crash bash dew to a segmentation violation.  It gives up at r=3234 with:

GNU bash, version 2.05.0(8)-release (i686-pc-cygwin)

and r=7817 with

GNU bash, version 2.00.0(1)-release (sparc-sun-solaris2.4)

This seems to be fairly repeatable.

Any thoughts?  I'll maybe have a go at debugging it my self once I have my Linux box back up and running.

Thanks

AJ

Dr Alexander J Turner


reply via email to

[Prev in Thread] Current Thread [Next in Thread]