Shell - find jar file which contains specific file



# find jar files       to execute zipinfo    pipe to to awk '/regexp condition/{expression}' pipe to awk 'row num ==1{print found file}; {print zipinfo file}'
find lib -name '*.jar' -exec sh -c "zipinfo {} | awk '/.*NameAbbreviator.*/{print \$0}'        | awk 'NR==1{print \"\n{}\"}; {print \$0}'" \;

別名演算法 Alias Method

 題目 每個伺服器支援不同的 TPM (transaction per minute) 當 request 來的時候, 系統需要馬上根據 TPM 的能力隨機找到一個適合的 server. 雖然稱為 "隨機", 但還是需要有 TPM 作為權重. 解法 別名演算法...