For example, I want to find all files in a directory that end in 'm' or 'sh'. The following works correctly:
find . -regex '.*.m' -o -regex '.*.sh'
But this fails:
find . -regex '.*.(m|sh)'
What am I doing wrong?
|
For example, I want to find all files in a directory that end in 'm' or 'sh'. The following works correctly:
But this fails:
What am I doing wrong? |
||||
|
|
|
Just escaping hell:
appears to work. I don't think there's much consensus whether regexp special chars need to be escaped or need to be unescaped between different tools. |
|||||||
|