I want to write a script using Oscam Casrdsharing server
this is my test:
cat oscam.log | grep "error"
sample output:
2018/10/17 16:43:07 5C94A12E p    (cccam) cccam(r) test.dyndns.org: login failed, error
Once I've found an error, I need to remove its information inside another file :
oscam.server
[reader]
label                         = test.dyndns.org
protocol                      = cccam
device                        = test.dyndns.org,12000
key                           = 0102030405060708091011121314
user                          = renegade
password                      = renegade123
inactivitytimeout             = 30
group                         = 1
cccversion                    = 2.1.2
cccmaxhops                    = 0
cccmindown                    = 1
ccckeepalive                  = 1
blalbal
blalblalb
blalblalb
lablalb
I need to delete those "test.dyndns.org" lines that matched. I would like to keep only the following :
blalbal
blalblalb
blalblalb
lablalb
So far, I've tried the following code :
awk '/test.dyndns.org/{while(getline && $1 != ""){}}1' oscam.server
#output is :
[reader]
blalbal
blalblalb
blalblalb
lablalb
But the line [reader] is still present. What could I do to remove the block entirely?
 
     
    