gpt4 book ai didi

linux - 尝试理解Linux中非shell元字符的含义

转载 作者:太空宇宙 更新时间:2023-11-04 03:38:02 25 4
gpt4 key购买 nike

谁能帮我理解一下

grep "[0-9]\{2\}" filename

这是一个非 shell 元字符命令。

最佳答案

grep 需要在量词中使用大括号反斜杠。

grep '[0-9]\{2\}'  #  n.b. the single quotes

双引号中,\{展开为{,需要反斜杠加反斜杠才能通过。

关于linux - 尝试理解Linux中非shell元字符的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30889943/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com