Re: user id validation

2008-07-02 Thread Randal L. Schwartz
$< is a uid getpwuid($<) looks up the info on that. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ f

Re: user id validation

2008-07-02 Thread Richard Lee
Rajnikant wrote: Hey Richard, I think $< returns user id. Correct me if I'm wrong ;-). yes, you are correct. I was reading the perldoc .. on this and I was bit confused at first, on $uid = getpwnam ($name); $name = getpwuid

RE: user id validation

2008-07-01 Thread Rajnikant
delivery - www.persistentsys.com -Original Message- From: Richard Lee [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2008 11:50 AM To: Randal L. Schwartz Cc: Rajnikant; beginners@perl.org Subject: Re: user id validation Randal L. Schwartz wrote: >>>>>> "Rajnikant&q

Re: user id validation

2008-07-01 Thread John W. Krahn
Randal L. Schwartz wrote: ""Rajnikant"" == "Rajnikant" <[EMAIL PROTECTED]> writes: "Rajnikant"> I think Work around for this is, "Rajnikant"> My $usr = $ENV { USER }; "Rajnikant"> If ($usr eq "userA") "Rajnikant">Go get it "Rajnikant"> Else "Rajnikant">Access restricted. No, you want

Re: user id validation

2008-07-01 Thread Randal L. Schwartz
> "Richard" == Richard Lee <[EMAIL PROTECTED]> writes: Richard> But I guess there is no way to get user id.. ? Did you miss my other answer? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Smalltalk/Perl/U

Re: user id validation

2008-07-01 Thread Richard Lee
Randal L. Schwartz wrote: "Rajnikant" == Rajnikant <[EMAIL PROTECTED]> writes: Rajnikant> Is there any such way to get home directory of user? Is there any such way that this might be, perhaps, oh, a FAQ? Oh, yes, let's see. $ perldoc -q tilde Found in /usr/libdata/pe

Re: user id validation

2008-07-01 Thread Randal L. Schwartz
> "Rajnikant" == Rajnikant <[EMAIL PROTECTED]> writes: Rajnikant> Is there any such way to get home directory of user? Is there any such way that this might be, perhaps, oh, a FAQ? Oh, yes, let's see. $ perldoc -q tilde Found in /usr/libdata/perl5/pod/perlfaq5.pod How can I

RE: user id validation

2008-07-01 Thread Rajnikant
-Original Message- From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2008 11:12 AM To: beginners@perl.org Subject: Re: user id validation >>>>> ""Rajnikant"" == "Rajnikant" <[EMAIL PROTECTED]> writes: "

RE: user id validation

2008-07-01 Thread Rajnikant
: +91 > (20) > 3023 2479 > > Persistent Systems - Innovations in software product > design,development and delivery - www.persistentsys.com > > > -Original Message----- > From: Richard Lee [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 02, 2008 10:18 AM > To: Perl Beginn

Re: user id validation

2008-07-01 Thread Randal L. Schwartz
> ""Rajnikant"" == "Rajnikant" <[EMAIL PROTECTED]> writes: "Rajnikant"> I think Work around for this is, "Rajnikant"> My $usr = $ENV { USER }; "Rajnikant"> If ($usr eq "userA") "Rajnikant">Go get it "Rajnikant"> Else "Rajnikant">Access restricted. No, you want scalar getpwwuid ($<).

Re: user id validation

2008-07-01 Thread Amit Saxena
- Innovations in software product design,development and > delivery - www.persistentsys.com > > > -Original Message- > From: Richard Lee [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 02, 2008 10:18 AM > To: Perl Beginners > Subject: user id validation > > I am jus

RE: user id validation

2008-07-01 Thread Rajnikant
vations in software product design,development and delivery - www.persistentsys.com -Original Message- From: Richard Lee [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2008 10:18 AM To: Perl Beginners Subject: user id validation I am just wondering how to validate a user who is using the s

user id validation

2008-07-01 Thread Richard Lee
I am just wondering how to validate a user who is using the script?? I wanted to allow only user below to be able to user the script and was thinking about userA(userid: 1077) userB(userid: 1088) userC(userid: 1099) so, inside of script, I would put, unless ( $userid =~ /1077|1088|1099/ ) {