JarScan, scan all JAR files in all subfolders for specific class

后端 未结 8 2222
一个人的身影
一个人的身影 2020-12-29 13:03

We are seeing an older version of a class being used, although we had the latest one deploy. To scan all JAR files in all subfolders of an application server, how do we writ

8条回答
  •  失恋的感觉
    2020-12-29 13:41

    #! /bin/sh
    
    path=$1
    segment=$2
    
    if [ -z "$path" ] || [ -z "$segment"  ]
    then 
        echo "Usage: $0  "
        exit
    fi
    
    for jar in $path/*.jar ; do echo " *** $jar *** " ; jar tf $jar| grep --color=always $segment; done;
    

提交回复
热议问题