#!/bin/bash ########################################################################## #FileName: GetSoFile.sh #Function: generate so file list. #Create time: 2015.09.15 ######################################################################### #可执行程序 module="$1" #路径 path="./$2" ldd $module | awk -v path=$path ‘ \ BEGIN{ "mkdir -p ‘$path‘" | getline; system("echo get lib, the file path is "path""); } !/not found/{ if(NF == 4) { libpath=$(NF - 1); system("cp "libpath" "path""); print "cp "libpath" "path""; } } /not found/{ lib=$1; cmd="locate "lib" | head -n 1"; cmd|getline pos; cpcmd="cp "pos" "path""; cpcmd|getline; print "cp "pos" "path""; } END{ system("echo get lib ok."); } ‘
时间: 2024-10-08 17:57:05