Re: Thanks for a smooth 2.6 to 2.8 transistion
On Tue, Dec 14, 2004 at 09:36:30PM +0100, Sven Luther wrote:
> > What about sites that have hundreds of users? Adding everyone to
> > the plugdev group would be somewhat unwieldy. (I'm not griping, I'm
> > just interested in a solution.) Is there an alternative to this?
> for user in `ls /home | grep -v lost+found`; do adduser $user
> plugdev; done
I don't mean to be picky, but...
my ($first, $last);
open CONF, "</etc/adduser.conf" or die;
next unless /^(FIRST|LAST)_UID=(\d+)/;
$1 eq "FIRST" and $first=$2;
$1 eq "LAST" and $last=$2;
die unless defined($first) and defined($last);
while (my ($name,undef,$uid,undef)=getpwent())
if ($uid >= $first and $uid <= $last)
print $name, "\n";
If it breaks, you get to keep as many pieces as you want.