How to see / Check the Step by Step Execution of a Shell Script for Debugging?

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
It is very important have the step by step execution feature for debugging for any kind of programming language. Using this feature you can see the variable values which are getting assigned during the script execution. In shell script you can use the –x option to see the step by step execution. See an example here.


I have a sample program here.
cat tst.sh
echo "Test Program"
read a
echo $a
if [ $a -eq 1 ]
then
echo "One"
else
echo $a
fi
See the execution here
$ ksh -x tst.sh
+ echo 'Test Program'
Test Program
+ read a
1
+ echo 1
1
+ [ 1 -eq 1 ]
+ echo One
One  

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer