In /usr/bin/dgrep line 24:
prog=`echo $0 | sed 's|.*/d||'`
     ^------------------------^ SC2006: Use $(...) notation instead of legacy backticked `...`.
           ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
prog=$(echo "$0" | sed 's|.*/d||')


In /usr/bin/dgrep line 33:
recursive=0
^-------^ SC2034: recursive appears unused. Verify use (or export if used externally).


In /usr/bin/dgrep line 69:
for pkgglob in "$@"; do dglob -0f "$pkgglob"; done | xargs -0r $prog $opts "$pat"
                                                               ^---^ SC2086: Double quote to prevent globbing and word splitting.
                                                                     ^---^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
for pkgglob in "$@"; do dglob -0f "$pkgglob"; done | xargs -0r "$prog" "$opts" "$pat"

For more information:
  https://www.shellcheck.net/wiki/SC2034 -- recursive appears unused. Verify ...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
  https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le...