【发布时间】:2020-10-25 04:01:55
【问题描述】:
只需要从命令的输出中提取括号内的字符串。
命令输出类似
Some sort of text I dont need
random text (text that I need to extract 123456)
我试过了,我用的是
command 123 | cut -d "(" -f2 | cut -d ")" -f1
输出结果为
Some sort of text I dont need
text that I need to extract 123456
我怎样才能输出
text that I need to extract 123456
我只需要一个管道。
TIA
【问题讨论】: