/bin/custom/zzGetProperties.sh - Bash Read Properties File Key
/bin/custom/zzGetProperties.sh
#!/bin/sh
#!/bin/bash
# Daha fazla bilgi icin / For more information:
# Ahmet Faruk Biskinler
# [email protected]
# Sample Run: sh bin/zzGetProperties.sh catalina.properties zTomcatName
# Sample Output:
BASEDIR=$(dirname $0)
source $BASEDIR/zzSettings.sh
zzThisFile=$0
args=$*
getByKey () {
file_name=$1
key_name=$2
#FILE=../conf/catalina.properties
#zTomcatName=$(grep -i 'zTomcatName' $FILE | cut -f2 -d'=')
zFileName=$file_name
zValue=$(grep -i $key_name $zFileName | cut -f2 -d'"' | cut -f2 -d'"' )
#echo $zFileName
#echo $key_name
#echo $zValue
if [ "$zValue" = "" ]
then
#echo -e ${RedF} " !!!!!!!!! $process_name = CALISMIYOR !!!!!!!!!!! "${Reset}
printf " ${RedF} !!!!!!!!! Bulunamadı !!!!!!!!!!! ${Reset}\n"
else
# echo $zValue
#return "$zValue"
echo -e $zValue
fi
}
#Main
#echo "Args: $*"
getByKey $args
Created 8 years ago by Ahmet Faruk Bişkinler
Last Updated 8 years ago by Ahmet Faruk Bişkinler