Skip to content

Instantly share code, notes, and snippets.

@mhermans
Created July 27, 2013 15:15
Show Gist options
  • Save mhermans/6095131 to your computer and use it in GitHub Desktop.
Save mhermans/6095131 to your computer and use it in GitHub Desktop.
[mhermans@web314 ~]$ cat setvar.sh
#!/bin/bash
export CUSTOMVAR=test_env_var
[mhermans@web314 ~]$ cat readvar.py
#!/usr/bin/env python
import os
print os.environ['CUSTOMVAR']
[mhermans@web314 ~]$ env | grep CUSTOMVAR
[mhermans@web314 ~]$ source setvar.sh
[mhermans@web314 ~]$ env | grep CUSTOMVAR
CUSTOMVAR=test_env_var
[mhermans@web314 ~]$ ./readvar.py
test_env_var
[mhermans@web314 ~]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment