2019-03-19 09:10:03 +00:00
|
|
|
|
# yank
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
> 从 stdin 读取输入并显示一个选择界面,该界面允许选择一个字段并将其复制到剪贴板。
|
2019-03-19 09:10:03 +00:00
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 使用默认分隔符(\f, \n, \r, \s, \t):
|
2019-03-19 09:10:03 +00:00
|
|
|
|
|
|
|
|
|
`{{sudo dmesg}} | yank`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 输入单行:
|
2019-03-19 09:10:03 +00:00
|
|
|
|
|
|
|
|
|
`{{sudo dmesg}} | yank -l`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 使用特定分 `=` 隔符输入:
|
2019-03-19 09:10:03 +00:00
|
|
|
|
|
|
|
|
|
`{{echo hello=world}} | yank -d {{=}}`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 只有与特定正则表达式匹配的内容才输入:
|
2019-03-19 09:10:03 +00:00
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
|
`{{ps ux}} | yank -g "{{[0-9]+}}"`
|