腳本去重so依賴庫

#!/bin/bash
#非l 開頭
#ls -l | grep -v  .sh  | awk '/^[^l]/ {print $0;}' > tmpSrc

#以 - 開頭
ls -l | grep \\.so  | awk '/^[-]/ {print $9;}' > tmpSrc
#cat tmpSrc 
echo "find the same  real soname........."
#awk ' {  printf $0"\n" ;cmd="readelf -d " $0; cmd2 =cmd  " | grep SONAME ";  system(cmd2);}' tm^Crc > tmpSrc2
awk ' { cmd="readelf -d " $0; cmd2 =cmd  " | grep SONAME ";  system(cmd2);}' tmpSrc > tmpSrc2

#大於兩次的
cat tmpSrc2 | uniq -c | grep -v "1 "> tmpSrc3
cat tmpSrc3

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章