Thursday, 24 October 2019

readcofig.sh

# Title:       ReadConfig.sh
# Description: Script for reading configuration file
# Date         Author              Description
# ------------ ------------------- -----------------------------------------

for f in Config.txt
do
while read x
do
x="`echo $x|grep -v "^#"|grep .`"
if [ "$x" != "" ]; then
PARAMETER=$(echo $x|tr '[a-z]' '[A-Z]'|cut -d "=" -f1);
VALUE=$(echo $x|cut -d "=" -f2|cut -d "#" -f1);
export $PARAMETER=$VALUE
fi
done < $f
done

No comments:

Post a Comment