Hacker News new | ask | show | jobs
by drran 1812 days ago
I can do this in bash too (partially), with `set -eE` and bash-modules:

  #!/bin/bash
  . import.sh strict log
  a() {
    b
  }
  b() {
    c
  }
  c() {
    d
  }
  d() {
    false
  }
  
  a
Result:

  $ ./test.sh
  [test.sh] PANIC: Uncaught error.
  at d(./test.sh:13)
  at c(./test.sh:10)
  at b(./test.sh:7)
  at a(./test.sh:4)
  at main(./test.sh:16)
However, it stops to work at some point, e.g. in `for` loop, or in a subshell. zsh is better in this regard.