shell 逐行处理字符串
#!/bin/bash
# name col2 col3 score
cat 123.txt |while read line;do
name=`echo $line | cut -d "," -f 1`
score=`echo $line | cut -d "," -f 4`
if [ $score -gt 80 ];then
echo $name $score
fi
done
#!/bin/bash
# name col2 col3 score
cat 123.txt |while read line;do
name=`echo $line | cut -d "," -f 1`
score=`echo $line | cut -d "," -f 4`
if [ $score -gt 80 ];then
echo $name $score
fi
done