parse an environment file

Chris Angelico rosuav at gmail.com
Sat Oct 6 13:33:16 EDT 2012


On Sun, Oct 7, 2012 at 4:14 AM, Jason Friedman <jason at powerpull.net> wrote:
>> The only canned solution for parsing a bash script is bash. Think
>> about it the other way around: If you wanted to have a Python variable
>> made available to a bash script, the obvious thing to do is to invoke
>> Python. It's the same thing.
>
> I scratched my own itch:
> http://code.activestate.com/recipes/578280-parse-profile/.

And there you have it! A subset of bash syntax and a Python parser. Job done!

ChrisA



More information about the Python-list mailing list