Thanks,#!/usr/bin/perl -w # # simple search and replace script - # for a snort rule # use strict; my $policy_file = "/usr/local/snort/rules/rules-new/policy.rules"; open(FILE,"$policy_file"); my @old_policy = <FILE>; close(FILE); open(FILE,">$policy_file"); for (@old_policy) { if (/^alert ip 63.251/) { $_ = "#$_"; } print FILE $_; } close(FILE);
In reply to Simple Search and Replace? by draper7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |