您的位置:首页 > 其它

cut、file、for、ls、的综合应用实例

2012-01-08 10:01 323 查看
#!/bin/bash

files=`ls $1/*.so`

if [ $# -eq 0 ]; then

    echo "Argument too less!"

fi

for file in $files; do

   if [ `file ${file} | cut -d" " -f5` != "shared" ]

   then

     file ${file}

     rm ${file}

     echo "Remove ${file}"

   fi

done
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  file less