在所有jar包中找指定字符串

在指定名称包含x或y的jar包中找指定字符串

find ./ \( -name "*x*.jar" -o -name "*y*.jar" \) -exec sh -c '
  echo "Scanning $1..."
  unzip -l "$1" | grep "\.class" | awk "{print \$4}" | while read class; do
    if unzip -p "$1" "$class" | strings | grep -q "gl/voucher"; then
      echo "Found in: $1 -> $class"
    fi
  done
' sh {} \;
posted @ 2025-03-29 18:43  明月心~  阅读(78)  评论(0)    收藏  举报