#!/bin/bash
while true
do
read -p "请输入学生学号:" stu_num
if [ $stu_num == exit ];
then
exit
fi
read -p "请输入学生姓名:" stu_name
read -p "请输入学生成绩:" stu_ach
stu_info=$(echo $stu_num $stu_name $stu_ach)
Stu_Ach=$(echo $stu_info |awk '{print $3}')
if [ $stu_ach -gt '60' ];
then
echo $stu_num $stu_name $stu_ach >> pass.dat
else
echo $stu_num $stu_name $stu_ach >> nopass.dat
fi
done
欢迎指正