wiki:awk

Version 1 (modified by yuna, 7 years ago) (diff)

--

特定の行にマッチしたn行前を表示

$ awk '{a[NR]=$0}$0~/read/{printf("%s\n",a[NR-5])}'  test.txt