bash -x set -x set +x
cat sc
#!/bin/bash
for i in {1..3}
do let i++
echo $i
done
#!/bin/bash
for i in {1..3}
do let i++
echo $i
done
----------
bash -x sc
+ for i in '{1..3}'
+ let i++
+ echo 2
2
+ for i in '{1..3}'
+ let i++
+ echo 3
3
+ for i in '{1..3}'
+ let i++
+ echo 4
4
------------------
use the set -x and set +x in the script to enable the -x log- ging feature of the shell just for that part of the script
use the set -x and set +x in the script to enable the -x log- ging feature of the shell just for that part of the script
Comments
Post a Comment