3 ms·
find $PATH -regex $FILENAME_REGEX -exec grep $CONTENT_REGEX grep -r [-E] $CONTENT_REGEX --include $FILEGLOB Your bonus case: find $PATH -regex $FILEN
by rhizome 6y ago
find $PATH -regex $FILENAME_REGEX -exec grep $CONTENT_REGEX
grep -r [-E] $CONTENT_REGEX --include $FILEGLOB
Your bonus case:
find $PATH -regex $FILENAME_REGEX \
-exec sh -c "grep [-E] -$NUMBER_OF_CONTEXT_LINES $CONTENT_REGEX1 | grep -l [-E] $CONTENT_REGEX2"
The "[-E]" here is just to mention the command switch if you want to use extended regex.
- suifbwish 6y agoAm I the only one that always creates an alias pointing grep to egrep? Not sure why I would ever want my regex to not be extended or why it would be fun to have to have to escape characters by default