Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # jsonenv reads a json object as input and produces
- # escaped shell commands for setting environment vars
- import json
- import pipes
- import sys
- for k, v in json.load(sys.stdin).items():
- k = pipes.quote(k)
- v = pipes.quote(str(v))
- print "export %s=%s;" % (k, v)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement