активировать отладочный удар
set -x #Just use this command to activate debugging within your code
## some code ... ##
set +x #Deactivate debugging
#Alternatively do
bash -x code.sh
Armandres