18,772
社区成员
发帖
与我相关
我的任务
分享
#!/bin/sh
echo -n "" >3.txt
cat 1.txt | sed 's/^$/##/g' | xargs | sed 's/##/\n/g' > 2.txt
cat 2.txt | grep -onE "[0-9]*% /data" | while read line
do
percent=$(echo $line | sed "s/.*:\(.*\)%.*/\1/g")
if [ $percent -gt 70 ];then
index=$(echo $line | sed "s/^\(.*\):.*/\1/g")
sed -n "${index}p" 2.txt| awk -F"|" '{print $1}' >> 3.txt
fi
done