in reply to Deleting lines from named.conf file
If you are trying to delete lines within left and right curly braces, {}, then you could use Range Operators:
This will delete all the text within the curly braces (the "junk" text), and will preserve all the text outside the braces (the "keep" text). The output of this script is:#!/usr/bin/env perl use warnings; use strict; while (<DATA>) { unless (/{/ .. /}/) {print} } __DATA__ keep { junk junk2 junk3 } keep keep2 keep3 { junk4 } keep4
If this does not help, perhaps you could provide a small sample of your input "hello" file, and show which line you want to delete from that file.keep keep1 keep2 keep3 keep4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Deleting lines from named.conf file
by firewall00 (Acolyte) on Nov 10, 2007 at 03:42 UTC |