Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
ERROR() {
trap 0
ecflow_client --abort =$$
exit 1
}
trap ERROR 0 $SIGNAL_LIST
# ...
function call {
 trap '{ echo "Error in function"; exit 1; }' 0 $SIGNAL_LIST
 set -ex
 # ...
 set -e; trap 0; return 0 ##### reset trap
 }
# ...
call
trap 0; ecflow_client --complete ; exit 0

...

Code Block
call() {
trap '{ ecflow_client --abort =$$; exit 1; }' 0 $SIGNAL_LIST
 set -ex
}

 

 


 In a similar way, in 'if' or 'while' expression, [[ ...]] or ((...)) shall be preferred to [...] to get the trapping propagated as expected.