Link to home
Start Free TrialLog in
Avatar of baburkhan
baburkhan

asked on

Bash database programming?

i want to make a student record database in bash programming in which i have the facility to search,edit existing record,deleting a existing record or add a particular record and any other extra
option that can be handled. what should be the code i am just a beginner in bash programming , how i handle the user input on a particulat key or like that , what would be the code shape,
is there sample bash programming database sample codes like this are online? waiting for your replies...
Avatar of owensleftfoot
owensleftfoot

If it was me, I would use perl rather than bash. http://www.tldp.org/LDP/abs/html/ is a great bash guide with a lot of sample code.
CC foot. Definitely simpler in perl;).

What type of "database" would that be? Are we thinking "flat file", dbm, "ISAM-ish" (berkeley DB perhaps) or RDBMS (MySQL, PostgreSQL or the like)?
Some of the above would not really be possible in "pure bash", but would need some kind of interpreter or like... psql for posgresql etc.
But perhaps it would be a flat file, in which case you'd rely heavily on diverse text/file utilities.

Is this a school assignment?

-- Glenn
Avatar of baburkhan

ASKER

ya it would be good to use pear , it would be a flat file for database in bash programming. But i dont know anything about pearl, can you people help me. But please can your tell me the sample databases in both pearl and bash , that would be easier for me.
it is not a school assignment it is related to my job. i have just started programming in Linux, otherwise i would have used SQL and VB.net in windows.
Ok... Working with a flat file is possibly, but... It'd be very cumbersome, be susceptible to file-locking issues and scale really badly.
Might one suggest that you go with either MySQL (http://www.mysql.com) or PostgreSQL (http://www.postgresql.org/) as your database (MySQL is perhaps a tad faster, while PostgreSQL (at least used to) boast the best stabdards compliance. I've used both and find them very good in different respect... Little things mostly:).
That way you could build your database in a somewhat familiar SQL environment, and have a choice... use commandline tools like mysql or psql (a bit like Oracles sqlplus tool), access it from perl via the DBD abstraction (after overcomming the hurdle of teaching yourself perl... might be a steep learning curve:), access it in a web context via simple PHP (which would perhaps most look'n'feel like VB... Look at http://www.php.net)... which would give you a consisten and easily deployable user interface, or use tools like kdevelop to build your GUI app (in this case for KDE)... The choices are endless, and depend on factors like how you plan to deply the app, who the target group is etc etc.

-- Glenn
Depending on how many students you are catering for, http://www.dplace.com/cardfile/ is a great flatfile database program. You can setup your own database with the fields you specify. IE in this case, student DOB,subjects,exam results etc. You can search on any field, use any field as an index etc. Why reinvent the wheel?
so cant anyone tell me the script programmnig in  bash for database of students? is there no work done on it? is there no example on it?
is there any example database in bash programming?
" is there any example database in bash programming?"

Why does it have to be in bash? Why do the programming work when  programs like the one I suggested above have already been written and will run a lot quicker because they have been written in C?
I'm guessing baburkhan is expecting us to do his homework for him, sort of:-). Since we're not allowed to do that, we won't;-).
What we will do is (of course) to point to likely resources (information, perhaps some example code, or (as in your case foot) fully functional opensource implementations) and comment on code (if any is shown)...
I'm sure there are "examples" like what is asked for, but nothing that comes readily to mind.
(I could also add ... Why not take one of the nice "alternatives" I and foot mention, and start asking from that? Since you don't baburkhan, it seems you have "requirements" you haven't mentioned to us;).

-- Glenn
Firslty, it is not some type of homework or so that you are guessing, if you are in job and your administrator has said you to work or complete the work according to his requirement how can we neglect that?????
if i asked you some bash programming database why are you trying to point that it is some sort of homework?
Secondly i am not good in using linux though i have used windows a lot, so if that would be in windows i had sed sql or access but i dont know how to use mysql in linux so i preffered bash as i have did some work in bash programming but never made a database.if i start leaning perl that will be taking much more time.
that why i was asking the database in bash programming.
ASKER CERTIFIED SOLUTION
Avatar of Gns
Gns

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial