swe*_*web 5 inotify regular-expressions exclude
我想通过inotifywait 以递归方式监视创建或修改文件的任何事件的特殊路径,但我不知道我的问题是什么。
我有一些要排除的文件夹。
watchpath
-> folder1
-> file1
-> ingnorefile1 [IGNORE]
-> ignorefolder1 [IGNORE]
Run Code Online (Sandbox Code Playgroud)
如何使用正则表达式正确排除它们?
inotifywait -mr --exclude '(ignorefolder1|folder1\/ingnorefile1)' -e modify -e create -e delete . | while read date time dir file; do
Run Code Online (Sandbox Code Playgroud)
用于实现我的目标的正确正则表达式是什么?
正确的正则表达式:(ignorefolder1|folder1/ingnorefile1). 但你的表达也有效。
使用反斜杠转义非元字符是错误的。“/”不是元字符,不需要转义。
| 归档时间: |
|
| 查看次数: |
9838 次 |
| 最近记录: |