The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-30-2007
LiquidChild LiquidChild is offline
Registered User
  
 

Join Date: Jul 2005
Location: Belfast
Posts: 49
Database drive script

I have decided to use a database table to allow the user to configure how my script should function, i.e. what menu options to display etc, and hold variable values in the table instead of a script. This means moving into different environments they should just be able to copy the script and then alter the database table without having to worry about changing code etc.

My question really is, is this possible?

I would like to read all the values in the table and put them in a variable with the same name, so that should i wish to just use a new variable all that needs to be done is to add it to the table and then it can be referenced in my scripts as a variable, since the code for reading the table would populate all the variables and give them the same name.

So for example my table is a name/value pair table and has:

SHOW_SQL_MENU Y
SHOW_LOG_MENU Y

Then in my scripit I can have something like

if [ "$show_log_menu" == "Y" ]
then
;
else
;
fi

Can anyone let me know if this is going to be a major thing to do, also any suggestions on how to do it?

Thanks