On Sep 21, 2006, at 10:32 AM, Kate Wood wrote:

> On 9/21/06, Alex Brelsfoard <[EMAIL PROTECTED]> wrote:
>> I know I've done this before, but I'm having a hard time finding  
>> my old
>> code, and am not using the right search terms on google...
>> All I am looking for is the quickest method to find the user who  
>> is calling
>> this script.
>> This is a script that will only ever be run by shell command on a  
>> Linux
>> system.
>
>
> my $user = `whoami`

Without shelling, use $<, or $REAL_USER_ID if you use English.

perl -le'print join ":",getpwuid($<)'

--
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance




 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to