diff options
-rwxr-xr-x | bin/grepc | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -234,18 +234,14 @@ grepc_patterns() } -grepc_search() -{ - pcre2grep -${iflag}${lflag}HMn --label="$file" -f <(grepc_patterns "$identifier") \ - | sed -E -f <(test "$kflag" = 'no' && echo 's/^[^: ]+:[0-9]+:/\n\n&\n/') \ - | perl -pe "$(test "$cflag" = 'yes' && echo 's/('"$identifier"')/\033[32m\1\033[0m/' || echo 's///')"; -} - - main() { grepc_parse_cmd "$@" </dev/null; - grepc_search "$identifier" <"$file" \ + + <"$file" \ + pcre2grep -${iflag}${lflag}HMn --label="$file" -f <(grepc_patterns "$identifier") \ + | sed -E -f <(test "$kflag" = 'no' && echo 's/^[^: ]+:[0-9]+:/\n\n&\n/') \ + | perl -pe "$(test "$cflag" = 'yes' && echo 's/('"$identifier"')/\033[32m\1\033[0m/' || echo 's///')" \ | if [ -n "$lflag" ]; then sort \ | uniq; |