Skip to content

Instantly share code, notes, and snippets.

@asenchi
Created October 17, 2017 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asenchi/e99a55b2128e5d03f64faa51cba4db8f to your computer and use it in GitHub Desktop.
Save asenchi/e99a55b2128e5d03f64faa51cba4db8f to your computer and use it in GitHub Desktop.

This sets up the environment that the scripts run in. I've found it to be the most flexible route as I don't have to do any complex config file formatting, and the environment becomes the config, which is easy to move around to different platforms (linux, BSD, Heroku, etc). Depending on what I am doing, I might also write a wrapper script that automatically sources the config and runs the script.

# config.sh                                                                    
KEY1="value"                                                                   
KEY2="value"                                                                   
TOPICAL_KEY3="value"                                                           
TOPICAL_KEY4="value"                                                           
                                                                               
export KEY1 KEY2 TOPICAL_KEY3 TOPICAL_KEY4
$ . config.sh
$ bin/myscript.sh
$ bin/myscript.pl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment