【发布时间】:2014-10-28 19:32:08
【问题描述】:
对于文件列表,我想匹配那些不以.txt 结尾的文件。我目前正在使用这个表达式:
.*(txt$)|(html\.txt$)
This expression will match everything ending in .txt, but I'd like it to do the opposite.
应该匹配:
happiness.html
joy.png
fear.src
应该 不 匹配:
madness.html.txt
excitement.txt
我想得到这个,这样我就可以和fswatch一起使用它:
fswatch -0 -e 'regex here' . | xargs -0 -n 1 -I {} echo "{} has been changed"
问题是它似乎不起作用。
PS:我使用标签 bash 而不是 fswatch,因为我没有足够的声望点来创建它。对不起!
【问题讨论】:
-
你是在 BASH 中做这个吗?
-
我已经更新了我的问题。我想用它作为 fswatch 的参数。