I've written a bash script, which process multiple files. I now want to add support for a config file. This is my wanted 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 within bash? Are there other recommendations? Remember, this should be in a config file...
Q2: I am thinking about one configuration file per 'set' like
/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 would 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 per set. I could support something like
path="/first/path /second/path"
But I think I'll get trouble with spaces, so I should introduce a delimeter like
path="/first/path:/second/path"
to split the string.
Or is there a better way?