Looking for a flat database library


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Looking for a flat database library
# 1  
Old 03-23-2012
Lightbulb Looking for a flat database library

Hello there,

At my formal company, there was a flat database library that was very convenient to use (under Unix Solaris)
Here is an example:

The below file (say printerslice) was used to store data of our printers.
We used it to ftp files to printers.

You could query the db as

Code:
printerslice country=at port=pr1 ip

That would have returned the list of ip addresses from Austria using port pr1

I would be one of the happiest man if you know something similar Smilie




Code:
#!/u/ss/bin/fdbsh
#@ country                       # ISO 3166-1 country code
#@ printer  !uniqkey             # printer name <ctry>_<number>
#@ fqdn     !uniqkey             # Fully Qualified Domain Name
#@ ip                            # IP address matching the fqdn.
#@ ff                            # Form Feed necessary?
#@ port    !default=n/a          # Logical port the printer prints on
#@ login   !default=pr2          # Login name used to print to the printer
#@ passwd  !default=n/a          # Password corresponding to the login name.
#####################################################################
country        at
printer        at_1
fqdn           at_1_printer.lanier-europe.com.
ip             192.168.215.20
port           pr1
ff             n
login          anyone
passwd         none
#####################################################
country        at
printer        at_3
fqdn           at_3_printer.lanier-europe.com.
ip             172.22.66.31
port           pr5
ff             y
login          anyone
passwd         none
#####################################################
country        at
printer        at_4
fqdn           at_4_printer.lanier-europe.com.
ip             172.22.66.32
port           pr1
ff             n
login          anyone
passwd         none




Last edited by radoulov; 03-23-2012 at 07:50 PM.. Reason: Code tags.
# 2  
Old 03-23-2012
You probably already have the Berkeley DB on your box, many UNIX systems come with one.

Berkeley DB - Wikipedia, the free encyclopedia

gdbm is another database that usually gets packaged with Linux and is free for any UNIX system.

Last edited by jim mcnamara; 03-23-2012 at 11:37 PM..
# 3  
Old 03-24-2012
Thanks Jim, I will check them.
(And thanks to Radoulov for the code tags)
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Programming

SQL for flat file database

I have a B+ tree flat file database which is used by the application we use. I would like to implement a SQL kind of access for that DB. I have implemented my data structures to parse and store the user written query for execution. But i would like to know, do we have any standard data... (2 Replies)
Discussion started by: kumaran_5555
2 Replies

2. Shell Programming and Scripting

Uploading a flat file into the database.

I want to upload a text file into the database. what is the command for that? Thanks in Advance. (1 Reply)
Discussion started by: Balkrishna
1 Replies

3. UNIX for Advanced & Expert Users

How to write Flat Files by shell script using Oracle Database

Hello There.. I came to a situation where I need to write flat files using shell scripts, I need to pull the records from the oracle database and create the flat file, This process should be automated. Can any shell script expert out here to help me.. please.. Will be really glad to... (3 Replies)
Discussion started by: coolbuddy
3 Replies
Login or Register to Ask a Question