【发布时间】:2016-01-14 06:24:39
【问题描述】:
我想在文件上使用 bash 来提取位于两个字符串之间的文本。已经有一些答案,例如:
Print text between two strings on the same line
但我想多次出现,有时在同一行,有时在新行上。例如,从这样的文件开始:
\section{The rock outcrop pools experimental system} \label{intro:rockpools}
contain pools at their summit \parencite{brendonck_pools_2010} that have weathered into the rock over time \parencite{bayly_aquatic_2011} through chemical weathering after water collecting at the rock surface \parencite{lister_microgeomorphology_1973}.
Classification depends on dimensions \parencite{twidale_gnammas_1963}.
我想找回:
brendonck_pools_2010
bayly_aquatic_2011
lister_microgeomorphology_1973
twidale_gnammas_1963
我想 sed 应该能够做到这一点,但我不确定从哪里开始。
【问题讨论】: