Hi,
I have this simple rescursive script.
#!/bin/ksh
#
PS4='+$(date "+%F %T") ${FUNCNAME[0]}() $BASH_SOURCE:${BASH_LINENO[0]}+ '
set -o xtrace # Comment this line to disable tracing.
if [ -z $count ]
then
count=0
fi
this_dir=`pwd`
if [ $count < 10 ]
then
((count++))
echo 'count '$count
${this_dir}/$0
fi
echo "Out of it!"
exit 0
As you can see I'm having it traced in the commands up-top.
I'm getting the following traced output:
c037024@svamn14glbsalh $ ./reroute.ksh
+2018-04-26 09:47:26 () :+ [ -z ]
+2018-04-26 09:47:26 () :+ count=0
+2018-04-26 09:47:26 () :+ pwd
+2018-04-26 09:47:26 () :+ this_dir=/home/c037024
+2018-04-26 09:47:26 () :+ [ 0 ]
+2018-04-26 09:47:26 () :+ ./reroute.ksh[13]: 10: cannot open [No such file or directory]
+2018-04-26 09:47:26 () :+ echo 'Out of it!'
Out of it!
+2018-04-26 09:47:26 () :+ exit 0
c037024@svamn14glbsalh $
Why does it not recognize the script I'm trying to call?