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

teamcity Automatic Agent Start under Linux

15 managing disk - understanding /etc/fstab xfs_admin mount -o rw,remount /