Comments (3)
The output you are seeing is correct given how the script was designed to work.
process_ini_file test.ini - this will parse the file and store the results in memory
process_ini_file test.conf - this will parse the second file but with the first file still in memory
The net result of working you are doing is:
cat < test.ini
[my_test]
test_1 = A
EOT
cp test.ini test.conf
cat test.ini test.conf > merged.ini
process_ini_file merged.ini
The code allows you to process multiple files in a script and treat them all as one merged in / config file.
It should be easy enough to add an option to purge anything that has already been loaded either with an additional optional parameter to process_inI_file
process_ini_file <purge_flag>
or another function which allows you to file by file
process_ini_file
process_ini_file
process_ini_file
purge_ini_file
from ini-file-parser.
Thanks for the quick response (and great script). I realize my mistake. i got the "error" when i tested the script. In reality, it won't be a problem. So for me it only remains to suggest to mention this to the documenation. Hats off.
from ini-file-parser.
I will add it to my backlog, as I like the idea of being able to purge loaded items or remove specific items and maybe even add a function to write the merged config into a new file.
To be honest this only exists because of a bet. A friend said he had never seen an ini file parser for bash (most languages have one or several implementations). I said it shouldn't be that hard to do it, and his reply was "I bet you can't" ... so I did :)
I have a lot of other projects on the go, and never really came back to this one to see what new cool things I could add to it, so it is nice to get a reminder it is still out there.
from ini-file-parser.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ini-file-parser.