I have the following lines in a file
shush1 120 60G
albi 0/0/60
shush2 120 120G
albi 0/20/60
I want to get the previous and current line, only if it start with albi. Means, output should look like:
shush1 120 60G albi 0/0/60
shush2 120 120G albi 0/20/60
I tried the below, but looks I'm missing something:
awk '{if($1 ~ "shush*") line0=$0 ; else if($1 ~ "albi*") print $line0,$0}'