This helpful script is used to read properties from a file for use in another script
-
Call the function with the properties file and an optional prefix
loadProperties "$1" "$2"
-
Example usage:
loadProperties examples/example.properties
-
Example accessing the properties:
echo "App Name: $appName"
-
Call the function with the properties file and the property key
getProperty "$1" "$2"
-
Example usage:
appName=$(getProperty examples/example.properties appName)
-
Example accessing the property:
echo "App Name: $appName"