emanuele6 1674772800 learn Example: Interrupt script if any element of arr starts with _ trap 'for d_x in "${arr[@]}"; do [[ $d_x = _* ]] || ! break; done || while read -rep "debug> "; do eval " $REPLY"; done' DEBUG . Now, you can inspect variables with `declare -p', modify variables, run commands, look at open file descriptors with `ls -l /proc/"$BASHPID"/fd' on linux, etc. to continue, use trap - emanuele6 1674772817 forget emanuele6 1674772832 learn Example: Interrupt script if any element of arr starts with _ trap 'for d_x in "${arr[@]}"; do [[ $d_x = _* ]] || ! break; done || while read -rep "debug> "; do eval " $REPLY"; done' DEBUG . Now, you can inspect variables with `declare -p', modify variables, look at open file descriptors with `ls -l /proc/"$BASHPID"/fd' on linux, etc. to continue, use trap - DEBUG; break emanuele6 1674774501 forget emanuele6 1674774598 learn Example: Interrupt script if any element of arr starts with _ trap 'for d_x in "${arr[@]}"; do [[ $d_x != _* ]] || ! break; done || while read -rep "debug> "; do eval " $REPLY"; done' DEBUG . Now, you can inspect variables with `declare -p', modify variables, look at open file descriptors with `ls -l /proc/"$BASHPID"/fd' on linux, etc. to continue, use trap - DEBUG; break