(Let's hope nobody will define a group composed only of numbers - let's hope it
isn't allowed at all - I should install Linux at home...)
# with only one command
#
# Author: Patrick Canterino <patshaping@gmx.net>
# with only one command
#
# Author: Patrick Canterino <patshaping@gmx.net>
-# Last modified: 2004-07-28
+# Last modified: 2004-08-01
sub chgrp($@)
{
my ($group,@files) = @_;
sub chgrp($@)
{
my ($group,@files) = @_;
- my $gid = getgrnam($group);
+ my $gid = ($group !~ /^\d+$/) ? getgrnam($group): $group;
return unless($gid);
return chown(-1,$gid,@files);
return unless($gid);
return chown(-1,$gid,@files);