#!/bin/bash
section=""
insect=0
while read line
do if [ "$insect" -eq "1" ] || [ "x$(echo -e $line | grep '\[begin')" != "x" ]; then
insect=1
section="${section}${line}\n"
else
continue
fi
if [ "x$(echo -e $line | grep '\[end')" != "x" ]; then
if [ "x$(echo -e $section | grep 'header=7075')" != "x" ]; then
echo -e "$section"
fi
section=""
insect=0
fi
done < OutpdirImpressions.log
(лучшая производительность, чем bash)
#!/usr/bin/env python
section = ''
insect = False
with open('OutpdirImpressions.log', 'r') as f:
while True:
line = f.readline()
if line == '':
break
if insect or line.startswith('[begin'):
insect = True
section += line
else:
continue
if line.startswith('[end'):
if 'header=7075' in section:
print(section)
section = ''
insect = False
Попробуйте Ubuntu-Tweak. Он удаляет старые ядра для меня.
Что это за работающее ядро?
Вы должны обратить внимание на это:
run-parts: executing /etc/kernel/prerm.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
dkms: removing: bcmwl 6.30.223.248+bdcom (3.16.0-34-generic) (x86_64)
-------- Uninstall Beginning --------
Module: bcmwl
Version: 6.30.223.248+bdcom
Kernel: 3.16.0-34-generic (x86_64)
-------------------------------------
Status: Before uninstall, this module version was ACTIVE on this kernel.