root/trunk/midgard/tools/yamp/remove_grps.pl

Revision 6972, 358 bytes (checked in by bergie, 6 years ago)

Fixing tmp file names

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1 #!/usr/bin/perl
2
3 #  remove _all_ groups from xml file
4 #  remember to kill all group references before
5
6
7 local $/;
8
9 open FILE, "< $ARGV[0]";
10 $xml = <FILE>;
11 close FILE;
12
13 # remove all "grp" elements (scary)
14 $xml =~ s#<grp.*?>.*?</grp>##sg;
15
16 open FILE2, "> /tmp/$1.$$";
17 print FILE2 $xml;
18 close FILE2;
19
20 system("mv", "/tmp/$1.$$", $ARGV[0]);
21 unlink("/tmp/$1.$$");
Note: See TracBrowser for help on using the browser.