From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 24 Nov 2009 17:28:32 +0100 Message-ID: From: Rudolf Sykora To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=000e0cd1467ce1c8b80479206e2e Subject: Re: [9fans] environment variables Topicbox-Message-UUID: 9f3d2840-ead5-11e9-9d60-3106f5b1d025 --000e0cd1467ce1c8b80479206e2e Content-Type: text/plain; charset=ISO-8859-1 > > if you want to re-get the value of an environment variable, > you can do: > > ifs=() var=`{cat /env/var} > Ok. So if one wants to update the rc's view of the environment, one must write sth. along the lines for(var in `{ls /env}) { ifs=() contents = `{cat /env/$var} if (~ $var *#*) fn `{echo $var | awk '{split($0, a, "#"); print a[1]}'} {$contents} if not var = $contents } ? Thanks Ruda --000e0cd1467ce1c8b80479206e2e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
if you want to re-get the value of an environment variable,
you can do:

ifs=3D() var=3D`{cat /env/var}

Ok. So if one wants to update the rc's view of t= he environment, one must write sth. along the lines

for(var in `{ls = /env}) {
=A0=A0=A0 ifs=3D() contents =3D `{cat /env/$var}
=A0=A0=A0 i= f (~ $var *#*) fn `{echo $var | awk '{split($0, a, "#"); prin= t a[1]}'} {$contents}
=A0=A0=A0 if not var =3D $contents
}

?

Thanks
Ruda
--000e0cd1467ce1c8b80479206e2e--