https://qiita.com/mashumashu/items/ee436b770806e8b8176f #!/bin/bash trap 'read -p "$0($LINENO) $BASH_COMMAND"' DEBUG echo foo echo bar if [ "$1" = "yes" ]; then echo bazz fi