#!/bin/bash
my_arr=(/tmp/kafka-logs/testkafka-guo-0 /tmp/kafka-logs/testkafka-guo2-0)
for d in ${my_arr[@]}
do
lis=$(find $d -name "*.log")
for file in $lis
do
echo '' > $file
done
done;
或者 清空命令
list1=$(ls *.log) list2=$(ls *.out) for file in $list1 $list2 do echo '' > $file done
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)