I'm new to bash scripting and have a question about using properties from a .properties file within a bash script.
I have seen a bash properties file that uses'.' between variable names, for example:
this.prop.one=someProperty
and I've seen them called from within a script like:
echo ${this.prop.one}
But when I try to set this property I get an error:
./test.sh: line 5: ${this.prop.one}: bad substitution
I can use properties if I do it without '.' in the variable names, and include the props file:
#!/bin/bash
. test.properties
echo ${this_prop_one}
I would really like to be able to use '.' in the variable names, and, if at all possible, not have to include . test.properties in the script.
Is this possible?
UPDATE:
Thanks for your answers! Well, then this is strange. I'm working with a bash script that looks like this (a service for glassfish):
#!/bin/bash
start() {
sudo ${glassfish.home.dir}/bin/asadmin start-domain domain1
}
...
...and there are property files like this (build.properties):
# glassfish
glassfish.version=2.1
glassfish.home.dir=${app.install.dir}/${glassfish.target}
...
So, there must be some way of doing this right? Are these maybe not considered 'variables' by definition if they're declared in a properties file? Thanks again.