gvar(1) -- display, set, or remove global variables.
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Resolve symbolic links to itself May 5, 2016
libexec Resolve symbolic links to itself May 5, 2016
man Update readme May 2, 2016
test Update shebang for Bats May 26, 2016
.codeclimate.yml Configure Code Climate May 1, 2016
.travis.yml Readme, license, man page, Travis CI Apr 25, 2016
LICENSE Readme, license, man page, Travis CI Apr 25, 2016
README.md Install using Homebrew May 8, 2016

README.md

gvar

Code Climate Build Status

gvar(1) -- display, set, or remove global variables*.

* When I say global variable, I refer to a key-value pair that you can read/write at any time in any terminal session. You can think this is similar to the environment variables because it's a set of dynamic-named values but they are not session-wide or system-wide related.

Description

gvar is a pure Bash key-value store where each user has a different collection of data. The records are stored in the user's home directory as ~/.gvar file.

Installation

Clone this repository:

$ git clone git@github.com:arturoherrero/gvar.git

Add gvar/bin/ to your PATH:

$ echo 'export PATH="${PATH}:path/to/gvar/bin"' >> ~/.bash_profile

Source your profile:

$ source ~/.bash_profile

OS X

$ brew tap arturoherrero/formulae
$ brew install gvar

Usage

To print out the names and values of all the global variables, use:

$ gvar

To set global variables, use arguments of the form <VARIABLE>=<VALUE>, setting variable <VARIABLE> to value <VALUE>:

$ gvar VARIABLE=VALUE

Setting a global variable to an empty value is different from unsetting it:

$ gvar VARIABLE=

To print the value of the global variable <VARIABLE>, use:

$ gvar VARIABLE

To remove (unset) a global variable <VARIABLE>, use:

$ gvar -u VARIABLE
$ gvar --unset=VARIABLE

To delete the environment, removing all the global variables, use:

$ gvar -d
$ gvar --delete-environment

Who made this?

This was made by Arturo Herrero under the MIT License. Find me on Twitter @ArturoHerrero.