#! /usr/bin/perl # config.debug.off: change all /CONFIG_xyz_DEBUG=y/ to /# CONFIG_xyz_DEBUG is not set/ # Randy Dunlap, April-2009 # $VER = "001"; use Getopt::Std; getopts("v"); my $changecount = 0; sub usage() { print "usage: config.debug.off [-v] < config.file1 > config.file2 [ver. $VER]\n"; print " -v : verbose\n"; exit (1); } ##if ($opt_v) { } LINE: while ($line = ) { chomp $line; if ($line =~ /^(CONFIG.*_DEBUG)=y/) { print "# $1 is not set\n"; $changecount++; } else { print "$line\n"; } } printf STDERR "$changecount lines changed\n";