Sunday, November 1, 2015

Bash Script Properties File Using '.' in Variable Name

#!/bin/sh

declare -A props
while read -r; do
  [[ $REPLY = *=* ]] || continue
  props[${REPLY%%=*}]=${REPLY#*=}
done </home/thin/ibrahim-scripts/release-scirpts/server.properties

echo "${props[datasource.name]}"