zBernie has asked for the wisdom of the Perl Monks concerning the following question:
We use a widely available perl script named "activity mail" to send email to developers who commit file to our cvs repository. The script sends a diff attachment with the email. The file name of the attachment is created like this:
filename=$user-@gm5,4,3,2,1,0-diff.txtThe problem is, regardless of who commits files, the $user is ALWAYS "bernie", which is my username on the cvs server. I found that the perl getlogin function always returns "bernie", regardless of who commits files:
my $user = getlogin || getpwuid($<) || "unknown";I bit more research, and I found that get login returns the user name associated with the controlling terminal. But is a remote CentOS 5.5 server. So why does getlogin think that "bernie" is logged into the controlling terminal on this remote server? -Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Why does getlogin always return same user name?
by Anneq (Vicar) on Jun 02, 2013 at 14:53 UTC | |
Re: Why does getlogin always return same user name?
by Anonymous Monk on Jun 03, 2013 at 05:15 UTC | |
by zBernie (Novice) on Jun 03, 2013 at 15:57 UTC |