RetroPie-Setup  4.8.7
Functions
inifuncs.sh File Reference

RetroPie inifuncs library. More...

Functions

 iniConfig (delim, quote, config)
 Configure an ini file for getting/setting values with iniGet and iniSet More...
 
 iniUnset (key, value, file)
 Unset (comment out) a key / value pair in an ini file. More...
 
 iniSet (key, value, file)
 Set a key / value pair in an ini file. More...
 
 iniDel (key, file)
 Delete a key / value pair in an ini file. More...
 
 iniGet (key, file)
 Get the value of a key from an ini file. More...
 

Detailed Description

RetroPie inifuncs library.

Function Documentation

◆ iniConfig()

iniConfig ( delim  ,
quote  ,
config   
)

Configure an ini file for getting/setting values with iniGet and iniSet

Parameters
delimini file delimiter eg. ' = '
quoteini file quoting character eg. '"'
configini file to edit

◆ iniDel()

iniDel ( key  ,
file   
)

Delete a key / value pair in an ini file.

Parameters
keyini key to operate on
fileoptional file to use another file than the one configured with iniConfig

◆ iniGet()

iniGet ( key  ,
file   
)

Get the value of a key from an ini file.

Parameters
keyini key to get the value of
fileoptional file to use another file than the one configured with iniConfig

The value of the key will end up in the global ini_value variable.

◆ iniSet()

iniSet ( key  ,
value  ,
file   
)

Set a key / value pair in an ini file.

Parameters
keyini key to operate on
valueto set
fileoptional file to use another file than the one configured with iniConfig

If the key already exists the existing line will be changed. If not a new line will be created.

◆ iniUnset()

iniUnset ( key  ,
value  ,
file   
)

Unset (comment out) a key / value pair in an ini file.

Parameters
keyini key to operate on
valueto Unset (key will be commented out, but the value can be changed also)
fileoptional file to use another file than the one configured with iniConfig

The key does not have to exist - if it doesn't exist a new line will be added - eg. # key = "value"

This function is useful for creating example configuration entries for users to manually enable later or if a configuration is to be disabled but left as an example.