nick34992
2/21/2017 - 6:48 PM

Bash: set -x, for, in, echo, do, done: Debug for Loop Using set xtrace

Bash: set -x, for, in, echo, do, done: Debug for Loop Using set xtrace

#!/bin/bash

for i in {1..6}
do
set -x
echo $i
set +x
done
echo "Script executed"