Am Tue, 21 Dec 2004 07:51:53 -0800 schrieb biner: > Hello, > > I have file called PARAMETRES that is used in bourne shell script to > define variable. In order to do so I put a ". PARAMETRES" line and the > script has acces to all the variable defined in the PARAMETRES file.
Hi, you can run ". PARAMETERS; set" with popen. Then read stdin and parse the lines: The lines from stdin look like this: ACLOCAL_PATH=/opt/gnome/share/aclocal BASH=/bin/bash BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i586-suse-linux") BASH_VERSION='2.05b.0(1)-release' COLORTERM=1 COLUMNS=143 CPU=i686 CVSROOT=:ext:[EMAIL PROTECTED]:/raid/develop CVS_RSH=ssh .... you could use '^(.*?)=(.*)$' as regex to parse each line group(1) is the variable name group(2) the value. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list