Sed 如何使用grep命令从语义发布输出中获取发布说明

Sed 如何使用grep命令从语义发布输出中获取发布说明,sed,Sed,我正在尝试使用语义发布自动化软件的发布。一切正常。我运行这个命令npx semantic release--no ci--dry run,并在终端中获得以下输出 ...some other output [1:01:55 pm] [semantic-release] › ⚠ Skip v0.1.1 tag creation in dry-run mode [1:01:55 pm] [semantic-release] › ✔ Published release 0.1.1 on defau

我正在尝试使用语义发布自动化软件的发布。一切正常。我运行这个命令
npx semantic release--no ci--dry run
,并在终端中获得以下输出

...some other output

[1:01:55 pm] [semantic-release] › ⚠  Skip v0.1.1 tag creation in dry-run mode
[1:01:55 pm] [semantic-release] › ✔  Published release 0.1.1 on default channel
[1:01:55 pm] [semantic-release] › ℹ  Release note for version 0.1.1:
## 0.1.1 (2021-01-24)

### Bug Fixes

    * ravgeet is fixing things (92797f6)
    * removed unwanted files (bdcc9ff)
    * this is another fix (dbef2fd)
现在我需要从输出中获取发行说明

## 0.1.1 (2021-01-24)

### Bug Fixes

    * ravgeet is fixing things (92797f6)
    * removed unwanted files (bdcc9ff)
    * this is another fix (dbef2fd)
如何使用grep命令或任何其他方法来执行此操作?

使用GNU sed

| sed -n '/^##/,$p'
-n
:除非明确说明,否则不要输出任何内容(此处使用命令
p

x,yp
:您可以用正则表达式(此处:
/^###/
)替换
x
y
、行号或特殊字符,如
$
<代码>$与此处输入的最后一行匹配

/^###/
:以两个
#
开头的行的正则表达式

p
输出sed的模式空间(当前行)


| sed'/^###/,$!d'
是一种更紧凑的表示法。我翻译
!d
带“不删除”


请参阅:
man sed
和使用GNU sed

| sed -n '/^##/,$p'
-n
:除非明确说明,否则不要输出任何内容(此处使用命令
p

x,yp
:您可以用正则表达式(此处:
/^###/
)替换
x
y
、行号或特殊字符,如
$
<代码>$与此处输入的最后一行匹配

/^###/
:以两个
#
开头的行的正则表达式

p
输出sed的模式空间(当前行)


| sed'/^###/,$!d'
是一种更紧凑的表示法。我翻译
!d
带“不删除”



请参阅:
man-sed

使用GNU-sed:
|sed'/^##/,$!天才!您如何找到解决方案?我很想学习这一点。使用GNU sed:
|sed'/^###/,$!天才!您如何找到解决方案?我很想知道这一点。