How do I grab an INI value within a shell script?
How about grepping for that line then using awk version=$(awk -F “=” ‘/database_version/ {print $2}’ parameters.ini)
How about grepping for that line then using awk version=$(awk -F “=” ‘/database_version/ {print $2}’ parameters.ini)
Best practice is, in each module, to have a logger defined like this: import logging logger = logging.getLogger(__name__) near the top of the module, and then in other code in the module do e.g. logger.debug(‘My message with %s’, ‘variable data’) If you need to subdivide logging activity inside a module, use e.g. loggerA = logging.getLogger(__name__ … Read more
Update 2016: with git 2.8 (March 2016), you can simply use: git config –list –show-origin And with Git 2.26 (Q1 2020), you can add a –show-scope option git config –list –show-origin –show-scope You will see which config is set where. See “Where do the settings in my Git configuration come from?“ As Stevoisiak points out … Read more
UPDATE: As the behaviour of spring.config.location now overrides the default instead of adding to it. You need to use spring.config.additional-location to keep the defaults. This is a change in behaviour from 1.x to 2.x When using Spring Boot the properties are loaded in the following order (see Externalized Configuration in the Spring Boot reference guide). … Read more
The value given for the type attribute represents the assembly-qualified name of the CustomSection type. From the Type.AssemblyQualifiedName documentation The assembly-qualified name of a type consists of the type name, including its namespace, followed by a comma, followed by the display name of the assembly. ConfigurationPropertyExample.CustomSection, ConfigurationPropertyExample from left to right consists of the namespace: … Read more
The error is precisely as indicated in a comment by @TomFenech. The first line (and possibly all the lines) in myconfig.cfg is terminated with a Windows CR-LF line ending. Bash considers CR to be an ordinary character (not whitespace), so it will set SOME_VAR to the two character string 2CR. (CR is the character with … Read more