Thanks everybody who has replied. Perhaps I will go with one of the following suggestions :
- popen with the cat /etc/passwd | grep ....
or
- read the /etc/passwd , /etc/group and parse them.
Thanks !!!!!
Vu
Umm I was just playing with id and if you
[EMAIL PROTECTED] tmp]$ id apache uid=48(apache) gid=48(apache) groups=48(apache) [EMAIL PROTECTED] tmp]$ id apache -u 48 [EMAIL PROTECTED] tmp]$ id apache -g 48 [EMAIL PROTECTED] tmp]$ id apache -gu id: cannot print only user and only grou
So forget about my earlier suggestion of cat'ing /etc/password and just use id
if you are trying to use the local uid then
[EMAIL PROTECTED] tmp]$ whoami | id uid=500(james) gid=500(james) groups=500(james),10(wheel)
Well at least we aren't limited for choice using *nix
-- James McDonald Singleton Australia
61+ (0)2 65712401 61+ 0428 320 219
Creativity is no substitute for knowing what you are doing.
Linux 2.6.0-james3 #4 Thu Oct 30 23:46:04 EST 2003 athlon i386 GNU/Linux 06:40:00 up 6:08, 3 users, load average: 0.44, 0.65, 0.44 _______________________________________________ Linux-users mailing list [EMAIL PROTECTED] Unsubscribe/Suspend/Etc -> http://smtp.linux-sxs.org/mailman/listinfo/linux-users
