4 ms·
Grep integration would be awesome -- e.g. "find files with name satisfying x and content satisfying y", or (even better) "files in which grep query y is satisfi
by Jeff_Brown 6y ago
Grep integration would be awesome -- e.g. "find files with name satisfying x and content satisfying y", or (even better) "files in which grep query y is satisfied within n lines of a spot satisfying grep query y".
- TruthWillHurt 6y agoIsn't this what pipes are for?
- tyingq 6y agoIt does support regex expressions directly: ~= | =~ | regexp | rx Used to check if the column value matches the regex pattern !=~ | !~= | notrx Used to check if the column value doesn't match the regex pattern
- rhizome 6y agofind $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