summaryrefslogtreecommitdiffstats
path: root/bin/grepc
diff options
context:
space:
mode:
Diffstat (limited to 'bin/grepc')
-rwxr-xr-xbin/grepc14
1 files changed, 5 insertions, 9 deletions
diff --git a/bin/grepc b/bin/grepc
index 6d70f99..40460e1 100755
--- a/bin/grepc
+++ b/bin/grepc
@@ -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;