grep 如果符合条件的话

grep the word if matching with condition

我有 2 个词 "staticed2f.css" 和 staticec3f.css 。大胆的字符确实经常改变。我想使用 grep 命令或任何其他脚本

来 grep 这些匹配 'static' 的词

谢谢

试试这个,

grep -o \static[a-zA-Z0-9]*\.css

换个词,

var="otherword"
grep -o \(static\|$var)[\-a-zA-Z0-9.]*\.(css|js)