歡迎您光臨本站 註冊首頁
Name: find-in-jar
Description: Find which jar file contains the specific class in current folder.
Usage: find-in-jar
Example: find-in-jar java.lang.Object
Source Code:
#!/bin/bash

find . -name "*.jar" > /tmp/find_in_jar_temp

while read line
do
if unzip -l $line | grep $1 &> /tmp/find_in_jar_temp_second
then
echo $line | sed 's#(.*)#x1b[1;31m1x1b[00m#'
cat /tmp/find_in_jar_temp_second
fi
done < /tmp/find_in_jar_temp


[火星人 ] Linux常用自定義腳本系列(find-in-jar) - 在當前目錄中查找包含著某個類的所有jar文件已經有512次圍觀

http://coctec.com/docs/linux/show-post-53176.html