Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5699964
  • 博文数量: 675
  • 博客积分: 20301
  • 博客等级: 上将
  • 技术积分: 7671
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-31 16:15
文章分类

全部博文(675)

文章存档

2012年(1)

2011年(20)

2010年(14)

2009年(63)

2008年(118)

2007年(141)

2006年(318)

分类: LINUX

2006-06-29 20:34:06

#!/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

阅读(1337) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~