getKV.sh
413 Bytes
#!/bin/bash
#key,val,filename
path=$(pwd)
for f in `ls $path | grep .properties`
do
cat $f | while read line
do
if [[ "${line:0:1}" != "#" && "$line" != "" ]];then
key=$(echo $line | awk -F '=' '{print $1}' | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g")
val=$(echo $line | awk -F '=' '{print $2}' | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g")
echo "${key}>${val}>${f}"
fi
done
done