Infering who the user is? [message #16443] |
Tue, 27 July 1999 00:00  |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
Greetings idl ones,
I'm a WinNT weenie, but would like to
find out how to identify a user when
the user starts an IDL procedure, on both
NT and UNIX OS.
Is this possible under unix?
Can I do something like cd ~ and
grab the folder name, or spawn and
call whoami? Actually, nevermind,
I'll spawn and call whoami.
Is there a more general solution?
Is user ID possible under WinNT?
As a general solution, is there an
IDL system variable that holds this info?
(searching for "user" or "who" or "system"
is about as useful as searching for
the letter "e")
thanks,
bob
"Thou shalt not worship false IDLs"
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
|
|
|
Re: Infering who the user is? [message #16522 is a reply to message #16443] |
Wed, 28 July 1999 00:00  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
rgs <dejastockwell@my-deja.com> wrote in message
news:7nkrp3$foc$1@nnrp1.deja.com...
> Greetings IDL ones,
>
> I'm a WinNT weenie, but would like to
> find out how to identify a user when
> the user starts an IDL procedure, on both
> NT and UNIX OS.
Under NT get the value (IDL procedure GETENV) of the environment variable
USERNAME.
Under Win95/98 (which you didn't ask about) USERNAME is not set
automatically on login, but it could be set in autoexec.bat.
Environment variables are case-insensitive in Windows.
With Unix the corresponding variable appears to depend on the shell, e.g.
LOGNAME in the C shell and USER in the bash shell, so I guess trapping the
output of whoami is the most general solution.
---
Mark Hadfield m.hadfield@niwa.cri.nz
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
|
|
|