[Tutor] really stange behaviour

Adinda Praditya pemrograman@telkom.net
Tue, 6 Nov 2001 22:55:21 +0700


This is a multi-part message in MIME format.

------=_NextPart_000_002A_01C16716.1CC1F820
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Take a look at this:
=3D=3D=3D
>>> import os
>>> user =3D os.getenv('USER')
>>> print user
dida
>>> group =3D os.system('set -- `groups $USER`; echo $3')
staff
>>> print group
0
=3D=3D=3D

How did this happened? The reason i create this is for managing users. I =
run python in my environment. How can i take the (os.system...) value?


------=_NextPart_000_002A_01C16716.1CC1F820
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT size=3D2>Take a look at this:<BR>=3D=3D=3D<BR>&gt;&gt;&gt; =
import=20
os<BR>&gt;&gt;&gt; user =3D os.getenv('USER')<BR>&gt;&gt;&gt; print=20
user<BR>dida<BR>&gt;&gt;&gt; group =3D os.system('set -- `groups $USER`; =
echo=20
$3')<BR>staff<BR>&gt;&gt;&gt; print group<BR>0<BR>=3D=3D=3D</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>How did this happened? The reason i create this is =
for=20
managing users. I run python in my environment. How can i take the=20
(os.system...) value?<BR></FONT></DIV></DIV></BODY></HTML>

------=_NextPart_000_002A_01C16716.1CC1F820--