pixelb / crudini

A utility for manipulating ini files
GNU General Public License v2.0
443 stars 63 forks source link

In UBI9, crudini DOES NOT list the sections parseable by shell correctly #108

Closed yanshein closed 1 week ago

yanshein commented 1 week ago

odbc.ini file has this content

[GOSALESDW_1021]
DATABASE=GOSALESDW_1021
HostName=my.appdomain.host
PortNumber=19132
ValidateServerCertificate=0

In UBI9, crudini lists the section parseable by shell INCORRECTLY.

crudini --get --format=sh /data/odbc/mssql/odbc.ini

gives the following output:

GOSALESDW_1021_DATABASE=GOSALESDW_1021
GOSALESDW_1021_HostName=my.appdomain.host
GOSALESDW_1021_PortNumber=19132
GOSALESDW_1021_ValidateServerCertificate=0

In UBI8, crudini lists the section parseable by shell CORRECTLY.

crudini --get --format=sh /data/odbc/mssql/odbc.ini

gives the following output:

GOSALESDW_1021
pixelb commented 1 week ago

crudini changed this behavior on purpose, as in the old version the --format=sh in your command above was a noop, and didn't actually do any sh identifier verification. I.e. if you remove the --format=sh portion of the command, it should behave the same on both UBI8 and UBI9. As you've seen, the new version of crudini then uses --format=sh on the whole file, to give a shortcut to evaluate the whole file in the format presented above.

When using --format=sh with --get section, or --get section param, the verification and quoting is performed similarly on all crudini versions