ince "foo" == "bar" numerically)
>
> > -Original Message-
> > From: Chas Owens [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 27, 2001 3:11 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: checking groups on unix
> >
> >
&g
($groupname ne "groupname") {
print "$file has bad groupname: $groupname\n";
}
}
(since "foo" == "bar" numerically)
> -Original Message-
> From: Chas Owens [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 27, 2001 3:11 AM
> To:
Check out the stat function -- it returns a long list of info., which will be of use
to you:
perl -e ' @list=stat("."); foreach(@list){printf "%o \n",$_;} '
The " printf %o " part prints the value in octal, which is what you're after. The
3rd value in the returned array $list[2] is the mode. on
How to build @files is left as an exercise for the reader.
foreach my $file (@files) {
#getgrpid returns the group file entry for a given group id.
my $groupname = (getgrgid((stat($file))[5]))[0];
if ($groupname != "groupname") {
print "$file has bad grou
Hello Joni,
Wednesday, June 27, 2001, PURMONEN, Joni <[EMAIL PROTECTED]> wrote:
PJ> I need to check the group status on numerous files/directories, and haven't
PJ> been able to fing out the best way to do it with perl. I simply need to see
PJ> if some directories do not have certain group set on