PDA

View Full Version : Creating a Hashtable



etrader
October 12th, 2011, 08:53 AM
I want to create a simple file-based database. How can I create a hashtable within my Ubuntu terminal?

ofnuts
October 12th, 2011, 09:19 AM
I want to create a simple file-based database. How can I create a hashtable within my Ubuntu terminal?A hashtable of what? Used how? Actually what makes you think you need a hashtable?

nvteighen
October 12th, 2011, 11:47 AM
A hashtable is a data structure which AFAIK isn't available in shell scripting languages... You could use a Python dictionary, a Perl hash, a Lisp hashtable, but I don't think bash or sh have one, mainly because of the purpose those languages have...

11jmb
October 12th, 2011, 06:39 PM
If you are looking for a pre-built data structure that is easy to implement, write a Python script

it can be done in bash as well:

http://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash


but to reiterate:



A hashtable of what? Used how? Actually what makes you think you need a hashtable?

pl@yer
October 12th, 2011, 06:55 PM
Hash table -that's gonna take a lot of hash!

moldaviax
October 17th, 2011, 12:41 PM
Was the idea to create a hashtable or hashmap in java, then save the object to disk? Are you talking about running a program from command line or actually scripting something in the terminal?

M