I want to search all the ksh scripts present from root directory and take out the directory path and check whether that directory is created /exists or not? this is the sample ksh script? Please help on this?
cd /home/edwprod/cormis/bin
if [ -f /home/edwprod/cormis/bin/churn.txt ]
then
echo " data not loaded in the table"
exit 0
else
cd /home/edwprod/edw/cfg
echo "XFB process is about to start"
/home/edwprod/edw/cfg/AUTOMATE_XFB_ADVISOR.ksh
fi
/osmf/mgmt/scheduler/edw/ROMEO/bin >cat EDWADVCHR.ksh
if [ -f /home/edwprod/cormis/bin/churn.txt ]
then
cd /home/edwprod/cormis/bin/
rm -f churn.txt
fi
/home/edwprod/cormis/bin/edw_etl_adv_churn_error.ksh CO_POP_ADVSR_DSCN_CHURN_I P
Here is an example script that tests if a list of directories exists or not.
It will print out the names of the missing directories, and exit with a non-zero return code if one of them is missing.
You could fix this script to create the missing directories if you want.
It’s not really necessary though. You could just adapt what you have and check that
cdworked: