如何用shell脚本遍历指定目录下的文件,并按后缀名分类

如题所述

第1个回答  2017-04-05
脚本1:
#!/bin/bash
#
#
cd /tmp/script
cfile=` find -name '*.c' `
hfile=` find -name '*.h' `
for fc in $cfile
do
cfname=`basename -s .c $fc`
cat $fc >/tmp/scripttest/$cfname.txt
done
for fh in $hfile
do
cp $fh /tmp/scripttest
done本回答被网友采纳
第2个回答  2017-01-22
#!/bin/bash
while true
do

if [ -f /root/*.warming ];then
cp /root/xxx.conf /tmp
fi
done
第3个回答  2019-07-02
搜一下:如何用shell脚本遍历指定目录下的文件,并按后缀名分类

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网