Skip to content
Ultra-simple key/value hash, for bash!
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test - Key/Value Store for Bash


Well, no, not technically. Bash doesn't support hashes natively. So, we fake it via obfuscated and escaped environment variables. For really simple use cases, it's almost good enough. On the plus-side, it's in memory and relatively fast.

Why would I use this?

You might use if you're reaching for a Bash solution but don't quite yet want to break into Ruby/Python/Perl, &c. I use it to load snippets of text into the shell for frequent and fast programmatic access.

Potential uses:

  • hardware catalog
  • phone directory
  • lightweight key 'registry'
  • dictionary/map/lookup table
  • implement a simple cache mechanism
  • store a histogram of frequently seen files/directories/processes
  • retrieve a count or list of unique keys stored
  • etc...

Show me


    $ source
    $ hsh set machine1 fqdn
    $ hsh set machine1 hw "Dell Poweredge 1950"
    $ hsh set machine1 user billybob

    $ echo "FQDN: $(hsh get machine1 fqdn)"

    # or, equivalently:
    $ hsh declare machine1
    $ machine1 set fqdn
    $ machine1 set hw "Dell Poweredge 1950"
    $ machine1 set user billybob

    $ echo "FQDN: $(machine1 get fqdn)"

Show me more

Well, ok. API doc

This software is released into the public domain. Please use it responsibly.


If a man wishes to rid himself of a feeling of unbearable oppression, he may have to take -- Friedrich Nietzsche

Something went wrong with that request. Please try again.