getting env variable from bourne shell script

Fredrik Lundh fredrik at pythonware.com
Tue Dec 21 11:08:58 EST 2004


Thomas Guettler wrote:

> you could use '^(.*?)=(.*)$' as regex to parse each line
> group(1) is the variable name group(2) the value.

may I recommend:

    key, value = line.split("=", 1)

</F> 






More information about the Python-list mailing list