![]() |
![]()
| ![]() |
![]()
NAME
LIBRARYshtk_import config SYNOPSIS
DESCRIPTIONThe Keep in mind that the hook will only be able to access the configuration variables previously registered with shtk_config_init(3). Any other variables will be hidden and not available to the hook. EXAMPLESConsider the following configuration file: SRCDIR=/usr/src show_srcdir_hook() { # Note that we can access SRCDIR directly, as would be normal in a # configuration file. No need to use shtk_config_get. echo "SRCDIR is ${SRCDIR}" } Then, we could process the file and execute the defined hook like this: shtk_config_init SRCDIR shtk_config_load ".../path/to/the/file/above.conf" # This will print nothing because SRCDIR is not available here. echo "SRCDIR is ${SRCDIR}" # But this will display the right SRCDIR value. shtk_config_run_hook show_srcdir_hook ERRORSErrors during the execution of the hook result in the termination of the script. SEE ALSOHISTORY
|