Forked from marcelbirkner/reading-property-from-file.sh
Created
September 19, 2017 09:46
-
-
Save talonx/235a6e59ef32b7e49a2518b197778b30 to your computer and use it in GitHub Desktop.
Read property from properties file within Shell Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PROPERTY_FILE=apps.properties | |
function getProperty { | |
PROP_KEY=$1 | |
PROP_VALUE=`cat $PROPERTY_FILE | grep "$PROP_KEY" | cut -d'=' -f2` | |
echo $PROP_VALUE | |
} | |
echo "# Reading property from $PROPERTY_FILE" | |
REPOSITORY_URL=$(getProperty "nexus.repository.url") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment