Google

对系统进行strip的脚本

2007-07-01 21:17 来源: CUDev.cublog.cn 作者:CUDev 网友评论 0 条 浏览次数 39
#!/bin/sh
#This is a scripe that copy the library file about a command.
#Auther:wangyao
#Mail:wangyao@cs.hit.edu.cn
#     ipconfigme@gmail.com
#Usage: dostrip /media/usbdisk

function striplib()
{
    file $file | grep "not stripped$"
       
    if [ $? -eq 0 ];then
        echo "No stripped:">>sizefile
        echo -n "size:">>sizefile
        ls -l  $file | cut -d" " -f5 >>sizefile
        size $file >> sizefile
        echo "stripped:">>sizefile
        strip $file
        ls -l  $file | cut -d" " -f5 >>sizefile
        size $file >> sizefile
    fi
}

System_Dir=$1

if [ ! -e $System_Dir ];then
    echo "The path you give doesn't exist!"
fi

find $System_Dir | grep -v '/$' >> lsfile

for file in $(cat lsfile);do # get the message in file
    striplib
done

rm lsfile
上一篇: 下一篇:

相关主题:strip

网友评论