I wrote a bash script that process multiple files. Now I want to add support for the configuration file. This is my requested data structure:
Array ( [0] => Array ( [name] => datset1 [path] => /var/lib/bliTool/ds1 [type] => cvs ) [1] => Array ( [name] => datset2 [path] => /var/lib/bliTool/ds2 [type] => xml ) [2] => Array ( [name] => datset3 [path] => /home/igor/test/ds3 [type] => cvs ) )
Q1 Is such a data structure possible in bash? Are there any other recommendations? Remember that this should be in the configuration file ...
Q2: I think of one configuration file for each set, for example
/etc/myApp/ /etc/myApp/myApp.conf /etc/myApp/datasets.d/ /etc/myApp/datasets.d/ds1.conf /etc/myApp/datasets.d/ds2.conf /etc/myApp/datasets.d/dsN.conf
and each /etc/myApp/datasets.d/dsN.conf file will look like
name=The DS name path=/the/path/to/the/ds/files type=thetype
What do you recommend? Is there a way to do everything in one file?
Q3: I want to support multiple path values for each set. I could support something like
path="/first/path /second/path"
But I think that I will have problems with spaces, so I have to enter a delimeter like
path="/first/path:/second/path"
to break the line.
Or is there a better way?
source share