bash -x set -x set +x

cat sc
#!/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

Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all