This shell script compares the partial strings and also says how do you use another file as config file inside the script.
========================================================
#! /bin/ksh
. `pwd`/config.txt
export RPT_DB_NAME="$1"
string='_rpt'
echo $RPT_DB_NAME | grep $string >> /dev/null
if [ $? = 0 ]
then
if [[ -e check.txt ]]
then rm check.txt
echo "Manu"
echo "Swami"
echo "File Check.txt is removed"
fi
echo "first loop"
echo "first loop"
echo "first loop"
else
echo "No Match Found"
echo "second loop"
echo "second loop"
echo "second loop"
fi
#print manu from the file config.txt
echo "$MANUSWAMI"
========================================================
#! /bin/ksh
. `pwd`/config.txt
export RPT_DB_NAME="$1"
string='_rpt'
echo $RPT_DB_NAME | grep $string >> /dev/null
if [ $? = 0 ]
then
if [[ -e check.txt ]]
then rm check.txt
echo "Manu"
echo "Swami"
echo "File Check.txt is removed"
fi
echo "first loop"
echo "first loop"
echo "first loop"
else
echo "No Match Found"
echo "second loop"
echo "second loop"
echo "second loop"
fi
#print manu from the file config.txt
echo "$MANUSWAMI"
1 comment:
It was very nice article and it is very useful to Linux learners.We also provide Linux online training
Post a Comment