Database drive script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Database drive script
# 1  
Old 05-30-2007
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
# 2  
Old 05-30-2007
In fact looking at this again, it looks very hard to do!

As it would mean that my menu options mite change dynamically, i.e. they decide not to show all two options, there could be more.

However it makes the case statement no longer work, as this relies on knowing what option 1 corresponds to and what option 2 corresponds to etc.

Would there be a way round this!?
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need help to move .csv file from UNIX path to windows shared drive or c:\ drive

Hi Guys, Can any one help me on this. I need help to move .csv/.xls file from unix path to windows shared drive or c:\ drive? Regards, LKR (1 Reply)
Discussion started by: lakshmanraok117
1 Replies

2. Homework & Coursework Questions

Help with Automobile Database Script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Maintain automobile records in a database Write a shell script to create, view and modify a simple database... (4 Replies)
Discussion started by: lopez214
4 Replies

3. Shell Programming and Scripting

CRON Job to copy database and replace existing database

I have a reseller account with hostgator, which means i have WHM and Cpanel. I have set up a staging environment for one of my wordpress installations (client website), which is essentially sitting at staging.domain.com (live site is at domain.com). The staging website is a complete copy of the... (1 Reply)
Discussion started by: nzrobert
1 Replies

4. Hardware

How to Clone a Drive with 512 byte Sectors to a Drive with 4096 bytes/sector (AF)?

I have a 320 GB drive which dual boots Windows and Debian: Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal):... (0 Replies)
Discussion started by: phillipsoasis
0 Replies

5. UNIX for Dummies Questions & Answers

maintain database script...

Hi there. i'm new user at here I need help for this. I need to write a script that maintains a database of cryptographic checksums. In other words, I need this script to check the files checksum whether the files has been modified or not. But i got no idea where to start. Hope anyone here can... (8 Replies)
Discussion started by: hihihehe
8 Replies

6. SCO

mounting USB floppy drive /Flash drive in OSR 6.0

Can anybody help me out to mount USB flash /floppy drive in sco openserver 6.0 . (5 Replies)
Discussion started by: sureshdrajan
5 Replies

7. UNIX for Dummies Questions & Answers

Map Drive From Windows To Apache Shared Drive?

Anyone know how I can map a windows drive to an apache shared drive? In my httpd.conf file, I have: Alias /merc_rpts/ "/u/merc_rpts/" <Directory "/u/merc_rpts"> Options Indexes </Directory> I'm able to bring up a browser and see the contents of this folder. In... (0 Replies)
Discussion started by: gseyforth
0 Replies

8. Shell Programming and Scripting

Shell Script: want to insert values in database when update script runs

Hi , I am new to linux and also also to shell scripting. I have one shell script which unpacks .tgz file and install software on machine. When this script runs I want to insert id,filename,description(which will be in readme file),log(which will be in log file) and name of unpacked folder... (1 Reply)
Discussion started by: ring
1 Replies
Login or Register to Ask a Question