Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement