Припустимо, мій текстовий файл виглядає приблизно так:
hello world1
foo bar2
hello world3
foo bar4
hello world5
foo bar
Якщо я запускаю цю команду grep -A 4 'hello' draft.txt, я вважаю, що вона надрукує щось подібне:
hello world1 <<<<<<< This line matches
foo bar2 <<< These lines are the printed because of -A 4
hello world3 <<<
foo bar4 <<<
hello world5 <<<
hello world3 <<<<<<< this line matches
foo bar4 <<< These lines are printed because of -A 4
hello world5 <<<
foo bar <<<
... < so on > ....
Але насправді це те, що він друкує це (що може бути особливістю / помилкою).
hello world1
foo bar2
hello world3
foo bar4
hello world5
foo bar
Це так, як це має працювати? як змусити його поводитись так, як я думав, що це буде? (який перемикач / варіант я використовую?)
