#!/usr/bin/perl -w # changes multple GIDs while only stat-ing each file once # 30 Aug 2004 use File::Find; @ARGV = ('.') unless @ARGV; my(%gids) = ( 7806 => 7206, 7802 => 7202, 8001 => 7002, 8040 => 7240, 21 => 7121, 7807 => 7207, 8041 => 7241, 8002 => 7000, 80 => 7180, 15 => 7180, 7801 => 7201, 8003 => 7000, 8000 => 7001, 7805 => 7205, 8042 => 7242 ); find(\&check_gids, @ARGV) || die "Couldn't find: $!\n"; sub check_gids { my($gid) = (stat($_))[5]; if (-e) { if ($gids{$gid}) { print "$File::Find::name: $gid -> $gids{$gid}\n"; chown(-1, $gids{$gid}, $_); } } }