Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Portable way to get information about the current user

1 view
Skip to first unread message

Peter Stoehr

unread,
Mar 11, 1998, 3:00:00 AM3/11/98
to

Hi out there,

I'm looking for a way to find out which user is executing a tcl-script.
Portable means that it should work on Windows-NT and on Unix-Systems.

Has anyone an idea ?

Thanks in advance
Peter

Cameron Laird

unread,
Mar 11, 1998, 3:00:00 AM3/11/98
to

In article <01bd4ceb$8149b9c0$0f8c18ac@muc14280>,

Peter Stoehr <pst...@amadeus.net> wrote:
>Hi out there,
>
>I'm looking for a way to find out which user is executing a tcl-script.
>Portable means that it should work on Windows-NT and on Unix-Systems.
.
.
.
The notion of "user" isn't particularly portable.
Here's a first approximation:

proc user {} {
global env tcl_platform

switch $tcl_platform(platform) {
windows {
return $env(USERNAME)
}
unix {
return $env(USER)
}
}
}
--

Cameron Laird http://starbase.neosoft.com/~claird/home.html
cla...@NeoSoft.com +1 713 996 8546 FAX

0 new messages