I want to delete a line between selected lines using sed:
e.g. : Between "bus" to "pins", delete lines conaining "signal" word.
Input :
bus
direction
signal new
signal old
pins
signal ok
end
Desired Output:
bus
direction
pins
signal
end
Please tell how to do it
kurumi
2
$ ruby -ne 'f=0 if $_[/pins/];f=1 if $_[/bus/]; next if f!=0 and $_[/signal/];puts $_' file
bus
direction
pins
signal ok
end
# sed '/bus/,/pins/{/signal/d}' file
bus
direction
pins
signal ok
end
Its working perfectly in linux. Thanks a lot!!
If possible, Can you suggest something which is compatible in solaris also as this is not running is solaris
---------- Post updated at 11:49 AM ---------- Previous update was at 11:46 AM ----------
Vow, sed is working in both solaris as well as on linux.....
Really thanks a lot