#!/bin/sh
#
# remove old so-lib at make submit
#
# @auth zhoulin@lianchuang.com
#
#
# Usage:
# keep_single_dir /ngboss/tuxapp/lculib /ngboss/tuxapp/lculib_old
#
keep_sosingle() {
LCULIBDIR=$1
LCULIBDIR_OLD=$2
find $LCULIBDIR -type f -name "lib*" | awk -F\- '{print $1}' | sort | uniq |\
while read prefix_so; do
idx=1
ls $prefix_so* | sort -r | \
while read file; do
if [ $idx -ne 1 ]; then
echo "moving " $file " from " $LCULIBDIR " to " $LCULIBDIR_OLD
mv $file $LCULIBDIR_OLD
fi
let idx=idx+1
done
done
}
keep_sosingle $1 $2
只保留某个目录下最新的so文件[用于清除LCULIB目录下的老so文件]
最新推荐文章于 2025-05-07 18:43:26 发布
4150

被折叠的 条评论
为什么被折叠?



