Create check_grade.sh
This commit is contained in:
1 parent
8a48827e87
commit
d0b22e787f
1 file changed
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# 清空输出文件
|
||||
>record2
|
||||
# 从 record 文件中读取每一行记录
|
||||
while read name ch math eng; do
|
||||
# 判断三个科目中是否有不及格(成绩低于 60)
|
||||
if [ "$ch" -lt 60 ] || [ "$math" -lt 60 ] || [ "$eng" -lt 60 ]; then
|
||||
echo "$name $ch $math $eng" >>record2
|
||||
fi
|
||||
done <record
|
||||
Reference in new issue
Block a user