#!/usr/bin/perl -w use strict; my $group = "sbo"; my $newstring = "sbo::18659:x0929,x1465,x1368,x5552; my $backup = "/etc/group"; my $new = "/etc/group.tmp"; #back up group `cp -f $backup $backup.4623`; #fix group open (GROUP, "<", $backup); open (NEW, ">", $new); while (){ s/^$group/$newstring/; print NEW $_; } close GROUP; close NEW; print "\n"; print "\n"; system("cat $backup |grep $group"); #system("ls -lad $dirs"); print "\n"; system("hostname"); print "\n";