Ini val
fs_ini_val¶
Read or write a value in an INI-style config file. Key is specified as "section.key". If no dot is present, uses "default" as the section. Read: fs_ini_val file section.key Write: fs_ini_val file section.key value [comment] The file is created if it does not exist.
Example¶
fs_ini_val /etc/myapp.ini database.host localhost
fs_ini_val /etc/myapp.ini database.host # => localhost
Arguments¶
- $1 (string): Path to .ini file
- $2 (string): Key in "section.key" form (or just "key" for the default section)
- $3 (string): Value to set (omit to read the _current value)
- $4 (string): Optional inline comment for a new entry
Exit codes¶
- 0: Success; 2 Missing arguments
Output on stdout¶
- Current value when reading