Przejdź do treści

TMP

awk '/^edit / {record=""; inside_record=1} inside_record {record = record $0 ORS} /^quit$/ && inside_record {inside_record=0; if (record ~ /chrvl\*\*\*/) print record}' nazwa_pliku
awk '/^edit / { record = $0; next } /^quit/ { if (record ~ /chrvl[a-zA-Z0-9]{1,4}/) print "\n" record; record = "" } { record = record "\n" $0 }' nazwa_pliku
awk '/^edit / {
    if (record ~ /chrvl\*\*\*/) {
        print record
        print ""
    }
    record = $0
    next
}
/^quit/ {
    if (record ~ /chrvl\*\*\*/) {
        print record
        print ""
    }
    record = ""
}
{
    record = record " " $0
}' nazwa_pliku

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Wymagane pola są oznaczone *