SHARE
TWEET

Untitled

a guest Jun 17th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2.  
  3. # jsonenv reads a json object as input and produces
  4. # escaped shell commands for setting environment vars
  5.  
  6. import json
  7. import pipes
  8. import sys
  9.  
  10. for k, v in json.load(sys.stdin).items():
  11.     k = pipes.quote(k)
  12.     v = pipes.quote(str(v))
  13.     print "export %s=%s;" % (k, v)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top