bug-bash
[Top][All Lists]
Advanced

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

Re: Recursively calling a bash script goes undetected and eats all syste


From: Marc Herbert
Subject: Re: Recursively calling a bash script goes undetected and eats all system memory
Date: Fri, 10 Dec 2010 14:40:02 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Thunderbird/3.1.6

> What if bash were only to allow scripts to call themselves with
> exec?

Tail calls are not the only useful type of recursion, they're just a
particular case  <http://en.wikipedia.org/wiki/Tail_call>
Sometimes you do want to return (and discard some lower side-effects)

(and it is not always obvious for a script to know what "itself" is)


> on the one hand software should be forgiving while on the other
> preventing every possible severe error is not easy.

Unix was not designed to be forgiving:
<http://www.faqs.org/docs/artu/ch03s01.html#id2888136>




reply via email to

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