Saturday, September 13, 2008

Comparing Partial strings and use of config file inside script

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"

1 comment:

Unknown said...

It was very nice article and it is very useful to Linux learners.We also provide Linux online training

 

Blogger news

Blogroll