On Fri, Jun 21, 2024 at 10:06 PM Chet Ramey <chet.ra...@case.edu> wrote:
>
> It's a bug in the script. If you want to run `kill 0', which sends SIGTERM,
> from a SIGTERM trap handler, you need to reset the SIGTERM trap to the
> default before doing so.
>
> Bash allows recursive trap handlers.
>
> What's happening is you're recursively invoking the trap handler until
> you exceed the stack space resource limit. Bash has an internal limit on
> how many times you can recursively eval a trap handler, but you run out
> of stack space before exceeding it.

Ok. But it's very suspicious for me because the script ended without
any issues on macOS.

mikhail@MBP-Mikhail ~> ./splitcurl.sh "ftp://test.rebex.net/no-file"; 10
Download failed!
mikhail@MBP-Mikhail ~>
mikhail@MBP-Mikhail ~> bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin24)
Copyright (C) 2007 Free Software Foundation, Inc.
mikhail@MBP-Mikhail ~>

-- 
Best Regards,
Mike Gavrilov.

Reply via email to