Aktív témák
-
Meg vmi (tdtam, hogy vmit elfelejtettem):
sed -e '/transaction start/,$d' -e '/transaction end/d'
helyett
sed -e '/^transaction start$/,$d' -e '/^transaction end$/d'
Ez annyi modositas, hogy ez csak olyan sorokra fog ramozdulni, amiben csak annyi van, hogy ''transaction end'', se tobb, se kevesebb (^ - sor eleje, $ - sor vege), az elso valtozat meg arra is illet volna, ha van pl egy ilyen sor a logban, hogy ''11:32 transaction ended successfully''. -
tac |sed -e '/transaction start/,$d' -e '/transaction end/d' |tac
Igeny szerint a tac is helyettesitheto azzal, hogysed -n -e '1! G' -e '$ p' -e 'h'

Ja, komment:
A tac ahhoz kell, hogy megforditsuk a file-t (aztan a vegen meg vissza).
A '/transaction start/,$d' torli az osszes sort a ''transaction start''-tol kezdve.
A '/transaction end/d' meg torli a vegen a transaction end-et (mert gondolom nem kell).
A tac sed verziojanak magyarazatatol eltekintenek, mert ez trivialis![;]](//cdn.rios.hu/dl/s/v1.gif)
(Igazabol a GNU sed doksijaban van peldakent, idemasolnam azt:
# from the second line, the buffer (which contains all previous lines)
# is *appended* to current line, so, the order will be reversed
1! G
# on the last line we're done -- print everything
$ p
# store everything on the buffer again
h
[Szerkesztve]
Aktív témák
- Apple iPhone 15 Pro 128GB, Kártyafüggetlen, 1 Év Garanciával
- Dell Alienware AW2521HFLA 25" 240Hz Gamer Monitor 27% ÁFÁS - 0248BE
- BESZÁMÍTÁS! Gigabyte B660M i5 12400F 32GB DDR4 512GB SSD RTX 3070 8GB Kolink Observatory HF 750W
- AKCIÓ Dell Latitude 5420 - i5 1145G7, 8-16GB RAM, SSD, jó akku, számla, 6 hó gar
- Dell XPS 13 9310 i7-1185G7 16GB 512GB 13" FHD+ 1 év garancia
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

![;]](http://cdn.rios.hu/dl/s/v1.gif)
