Я должен найти строки со статьями, которые я сам установил. Поиск среди первых 10 строк.
sed -n '/the/p' file.txt | sed -n '/ a /p' file.txt
покажет только результат последней команды. Также
sed -n '1,10 /the/p' file
или
sed -n 1,10p '/the/p' file
не работает, я нашел использование диапазона только с такими шаблонами, как
[range]/s/pattern/pattern/p
Как мне объединить несколько условий и диапазон линий?
Пример файла:
For the first time since early February
the top three films at the weekend
box office were all new releases
and leading the way was
Fox's Bohemian Rhapsody
with a $50 million
chart-topping performance
well above expectations.
That said, the weekend isn't all about
new releases as the holdovers
Вывод должен быть:
For the first time since early February
the top three films at the weekend
and leading the way was
with a $50 million
That said, the weekend isn't all about
new releases as the holdovers