I would like to create a configuration file where I can place predefined variables for my shell script(s) to use instead of having to change every script to point to say, a log directory, every time I wanted to change the destination of where I would like my log files kept when they were generated.
Example 1:
I would like for my shell script “go.sh” to use the variables defined in the configuration file “config.conf”
Example 2:
Configuration file (config.conf)-
-Contents-
LOGS=/usr/logs
Shell Script (go.sh)-
-Contents-
#!/bin/ksh
print “The location of the log file directory is, $LOGS”
STOUT-
The location of the log file directory is, /usr/logs
Is there a mechanism that can read all of the variables that are defined on each line of the configuration file, so that all I have to do is use the variable name inside of my shell script and the value will be used during runtime of the script? If possible, what would the syntax be?
Example 1:
I would like for my shell script “go.sh” to use the variables defined in the configuration file “config.conf”
Example 2:
Configuration file (config.conf)-
-Contents-
LOGS=/usr/logs
Shell Script (go.sh)-
-Contents-
#!/bin/ksh
print “The location of the log file directory is, $LOGS”
STOUT-
The location of the log file directory is, /usr/logs
Is there a mechanism that can read all of the variables that are defined on each line of the configuration file, so that all I have to do is use the variable name inside of my shell script and the value will be used during runtime of the script? If possible, what would the syntax be?