I am a newbie to shell scripting and to learn it I took a project in which I m facing a tremendous amount
problems....I Need Your HELP!! the Details of project are as follows:
while learning shell scripting, i came up with an idea to make a 'Database/Record management system' as
my major project in this semester
with a specific query language to interact with it. what i wanted was...
as when you type like
in Oracle , you get the result of
desired fields..i wanted the same thing to happen when i invoke a command in terminal with
column names as arguments... it should get the output as we get in SQL Prompt.
the whole thing i wanted to create a package/utility for unix/linux that could emulate SQL.. i.e, to create
CREATE,SELECT,INSERT, etc all DML, DDL,TCL commands. I named this 'GQL'...
now the whole process should go as follows:
when you type gql in terminal you should get a restricted environment with GQL prompt,
*******************************************************************************
in simple meaning ..a Database means collection of tables...so creating a database would simply mean creating
a directory and creating a table means creating file in particular directory...
all the record is in the form of text delimited by colon !!
the problem i m facing is how to implement the 'Datatype' & 'Constraints' over the fields..as they are mere the text of a file!!
i have written the 'gql' script which is mere a prompt changing $ path setting script but i wanted that when GQL prompt appears no other shell commands like 'cd', 'mkdir' etc could run it should be a separate environment. plz tell me how can i achieve this.
I have also written the 'project' script which resembles the SQL , SELECT Statement without WHERE Clause....now i want to add the Where clause functionality to it but i cudn't find any approach for it ...plz help!!
********************
i know u'd say that this is of no worth as we already have Oracle, PostgreSQl, MySql....the openoffice Databases..and hundreds of utility of this kind.... which are a thousands times better than this. but its my college project and by the end of semester i have to submit it...and I've already started!! so plz guide me!!!
I want ur reviews , comments, suggestions over the project...its feasibility that what i m thinking of is possible or not....its enhancement and scope.. other alternatives how can i make it better and significance...
I m attaching the screen sccreenschots of my work along with the scripts....
plz Do hav look over it...GUIDE me to optimize the scripts..
NOTE: plz dont over my scripts .. as i m a newbie!!
You should be able to write a script that validates each field before it is added to the database, and at anytime that it is modified.
Some field types would have generic solutions (date/time), others might be specific to the table/field (dept number, salary), others might have to belong to a list.
Either use exit values from the validation script, or test the output from the validation against the input, to decide how to proceed.
Are you planning on having one record per file, and using the directory structure as the indexes?
what i have planned... consider directory named 'employee'.. now directory contains files related to employee information...just as the the default 'employee' databse of oracle contains tables like emp, dept,location salgrade etc...the directory 'employee' would contain files - emp, dept,location, salgrade etc.
so the a directory is analogous to a database and files are analogous to the tables of any database..
and the information within file is organized as below;
the content of the file 'emp' is:
I have written a script named 'project'..if U see the attached screenshot,, to project the specified columns in arguments to STDOUT. now i want to add up a filtering functionality based on conditions ..as WHERE clause of SQL..please suggest me any approach to accomplish this!!
now i m planning to write a script to insert the values in the file in the form as:
now the problem is to validate that while entering the values for 'empno' it shud be integer and for 'ename' it must be characters..so on...please guide me to accomplish this ......
can you please elaborate how can do this using exit values...should i have to make a separate validation script or it shud be a function in the script!!
If you increase the number of directories, you can reduce the number of records per physical file.
For instance
$EMPLMASTER/$DEPT/$EMPLNUMBER/
then in this directory have multiple files but only one record per file
For instance file1 contains employee#, name, address, hire date, date of birth,etc
A second file, file2 contains work history, one field of indeterminate length.
A third file, file3, contains salary information
To SELECT * FROM EMPLMASTER
cat $EMPLMASTER/*/*/file1 >>result
TO SELECT DEPT=1 from EMPLMASTER
cat $EMPLMASTER/1/*/file1 >>result
When you want to validate a field, can we assume for expedience that any invalid value will be replaced by the default value.
So to insert the hire month we will write a simple script that accepts one parameter (month, Jan thru Dec) and checks to see if it is in a table, if not, the current month is used.
monthtable.en is a file containing
Jan
Feb
Mar
Apr
May
...
Dec
And to insert a new record
Jack
Last edited by jgt; 02-18-2010 at 09:49 PM..
Reason: typos
I have a project tree like that.
after running find command with the -no -empty option, i am able to have a list of non empty directory
DO_MY_SEARCH="find . -type d -not -empty -print0"
MY_EXCLUDE_DIR1=" -e NOT_IN_USE -e RTMAP -e NOT_USEFULL "
echo " " > $MY_TEMP_RESULT_1
while... (2 Replies)
A new project was posted on your project board.
Project title: Bash Shell Tutoring
Estimated Budget:
$50/hr
Start date:
Immediately
Required skills:
Linux, Bash, Shell, UNIX
I work as a datawarehouse designer and developer.
Although I usually stick to the role of an analyst,... (0 Replies)
i have two doubts..
1. what is the use /etc/project file. i renamed this file and when i tried to switch user or login with some user account the login was happening slowly. but when i renamed it to original name it was working fine... why so?
2. unix already has useradd and grouadd for... (4 Replies)
Hey guys, I'm working on a project where we have to duplicate the 'dc' command. I'm having trouble figuring out how to queue the different commands available (such as printing stack contents or saving/executing macros and registers). I'm also having a great deal of trouble finding any literature... (1 Reply)
I am using mpc8xx processor with linux-2.4.20 kernel. These prints are getting flooded to my console almost consistenly.
14 06:29:17 MC4L-TP01 syslog.warn klogd: pte @ 0x10113d88: (0xc51cc100)->(0xc4bd144c)->0x01eec889
Oct 14 06:29:17 MC4L-TP01 syslog.warn klogd: RPN: 01eec PP: 2 SPS: 1 SH:... (1 Reply)
We have a system running ssh. When a user logs in, they do not get the project they are assigned to (they run under "system"). I verify the project using the command "ps -e -o user,pid,ppid,args,project". If you do a "su - username", the user does get the project they are assigned to (and all... (2 Replies)
Hello all,
Am new to the forum and hope this post meets the requirements.
This post will be rather lengtly but needs to be to explain the problem.
I have two computers running Windows 2000 Pro. I travel for a living and use a terminal emulation program called STEP to connect to our Unix... (2 Replies)