shell file_operate
来源:互联网 发布:凤阳安广网络 编辑:程序博客网 时间:2024/05/09 04:47
#########################################################################
# File Name: opearate.sh
# Author: ma6174
# mail: ma6174@163.com
# Created Time: 2015年02月02日 星期一 14时59分41秒
#########################################################################
#!/bin/bash
echo "1:execute\n"
echo "2:lib\n"
echo "3:include\n"
echo "4:sourse\n"
read i
echo "inputdir"
read inputdir
echo "outputdir"
read outputdir
cd $inputdir
##########################################################################
#move all executable file to outputdir
if [ $i -eq 1 ]; then
for file in `ls -F $inputdir`
do
if [ -x $file -a ! -d $file ]; then
filelist[$i]=$file
i=`expr $i + 1`
mv $file "$outputdir"
fi
done
fi
##########################################################################
#move all lib file to outputdir
if [ $i -eq 2 ]; then
for file in `ls $inputdir | grep lib*.*`
do
mv $file "$outputdir"
done
fi
##########################################################################
#move all source file to outputdir
types=($(awk '{print $0}' type))
if [ $i -eq 3 ]; then
for type in ${types[*]}
do
for file in `ls $inputdir | grep *."$type"`
do
mv $file "$outputdir"
done
done
fi
##########################################################################
#move all include file to outputdir
if [ $i -eq 4 ]; then
types=($(awk '{print $0}' type))
for type in ${types[*]}
do
for file in `ls $inputdir | grep *."$type"`
do
mv $file "$outputdir"
done
done
fi
# File Name: opearate.sh
# Author: ma6174
# mail: ma6174@163.com
# Created Time: 2015年02月02日 星期一 14时59分41秒
#########################################################################
#!/bin/bash
echo "1:execute\n"
echo "2:lib\n"
echo "3:include\n"
echo "4:sourse\n"
read i
echo "inputdir"
read inputdir
echo "outputdir"
read outputdir
cd $inputdir
##########################################################################
#move all executable file to outputdir
if [ $i -eq 1 ]; then
for file in `ls -F $inputdir`
do
if [ -x $file -a ! -d $file ]; then
filelist[$i]=$file
i=`expr $i + 1`
mv $file "$outputdir"
fi
done
fi
##########################################################################
#move all lib file to outputdir
if [ $i -eq 2 ]; then
for file in `ls $inputdir | grep lib*.*`
do
mv $file "$outputdir"
done
fi
##########################################################################
#move all source file to outputdir
types=($(awk '{print $0}' type))
if [ $i -eq 3 ]; then
for type in ${types[*]}
do
for file in `ls $inputdir | grep *."$type"`
do
mv $file "$outputdir"
done
done
fi
##########################################################################
#move all include file to outputdir
if [ $i -eq 4 ]; then
types=($(awk '{print $0}' type))
for type in ${types[*]}
do
for file in `ls $inputdir | grep *."$type"`
do
mv $file "$outputdir"
done
done
fi
0 0
- shell file_operate
- 改进file_operate
- shell
- shell
- shell
- shell
- shell
- Shell
- shell
- Shell
- shell
- shell
- SHELL
- Shell
- shell
- shell
- shell
- shell
- 85ViewTreeObserver.addOnGlobalLayoutListener(listener)
- 设计模式之状态模式
- Algorithm Gossip: 超长整数计算(大数计算)
- Access denied for user 'root'@'localhost' (using password
- ecshop 支付宝自动发货接口-修改版
- shell file_operate
- 1027. Colors in Mars (20)
- Algorithm Gossip:长PI
- 如果有对应的库存存在,则提示客户购买
- php调试工具
- with open('abc.txt', 'r') as f
- 蓝桥杯 入门训练 圆的面积 JAVA
- Make3D Convert your image into 3d model
- Algorithm Gossip: 最大公因数、最小公倍数、因式分解