floydthewall
asked on
getting 'whoami' info into a string
hello,
I want to have a script that will email the user once it is finished. For that I need to have a small function at the end that will check who the user is and then if it is 'floyd' if will send an email to floyd.
the part I am having problems with is identifying the user , for that I though the unix command 'whoami' would be good.
any ideas ,
cheers,
floyd.
I want to have a script that will email the user once it is finished. For that I need to have a small function at the end that will check who the user is and then if it is 'floyd' if will send an email to floyd.
the part I am having problems with is identifying the user , for that I though the unix command 'whoami' would be good.
any ideas ,
cheers,
floyd.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
#!/usr/bin/perl -w
#
#
$WhoAmI = `whoami`;
if($WhoAmI eq 'floyd')
{
print"Emailing floyd\n";
}