相关疑难解决方法(0)

打印两个图案之间(并排除)之间的线条

我将使用 cURL 提交表单,其中一些内容来自其他文件,使用选择 sed

如果param1使用来自其他文件的行匹配模式sed,下面的命令将正常工作:

curl -d param1="$(sed -n '/matchpattern/p' file.txt)" -d param2=value2 http://example.com/submit
Run Code Online (Sandbox Code Playgroud)

现在,去解决问题。我只想显示 2 个匹配模式之间的文本,不包括匹配模式本身。

可以说file.txt包含:

Bla bla bla
firstmatch
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
secondmatch
The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look …
Run Code Online (Sandbox Code Playgroud)

sed text-processing

15
推荐指数
3
解决办法
3万
查看次数

标签 统计

sed ×1

text-processing ×1