why isn't this regex working: find ./ -regex '.*[mh]$' | sort | grep --exclude="UnitTests" *
why isn't this regex working:
find ./ -regex '.*[mh]$' | sort | grep --exclude="UnitTests" *
The following works:
find ./ -regex '.*[mh]$' | sort
find ./ -regex '.*[开发者_如何学运维mh]$' | sort | grep "UnitTests"
When I'm adding the "--exclude" (as I want everything but lines with UnitTests in them) I seem to come to grief.
I'm on Mac OSX
Use
find ./ -regex '.*[mh]$' | sort | grep -v "UnitTests"
instead. --exclude
is used when recursing subdirectories, but your grep
is done based on the pipe (the output) from find ./ -regex '.*[mh]$' | sort
.
精彩评论