linux实现学生信息管理系统,在Linux下Shell编程实现学生信息管理系统

这是一个利用Shell脚本在Linux环境中创建的学生信息管理系统,包括学院和学生的信息增删改查功能。通过对话框交互式操作,用户可以插入、删除、修改和显示学生及学院记录,并能统计特定学院的学生数量。
摘要由CSDN通过智能技术生成

#! /bin/sh

insert_s()

{

file_name="/root/aillo/students.db"

dialog --title "Student: Insert a record " --inputbox "Please input the student's information in the sort:(id,name,college):" 20 50 2>tmp.txt

content=$(cat tmp.txt)

IFS=","

read sid sname sin

unset IFS

grep -c "$sid" $file_name>menu.txt

sid=$(cat menu.txt)

if [ "$sid" != "0" ];then

dialog --title "ERROR" --msgbox "Record has existed!" 20 30

else

echo "$content">>$file_name

dialog --title "Reply Info" --msgbox "Add successfully!" 10 30

fi

}

insert_c()

{

file_name="/root/aillo/colleges.db"

dialog --title "College: Insert a record " --inputbox "Please input the college's information in the sort(cid,cname):" 20 50 2>tmp.txt

content=$(cat tmp.txt)

IFS=","

read cid cname

unset IFS

grep -c "$cid" $file_name>tmp.txt

cid=$(cat tmp.txt)

if [ "$cid" != "0" ];then

dialog --title "ERROR" --msgbox "Record has existed!" 30 50

else

echo "$content">>$file_name

dialog --title "Reply Info" --msgbox "Add successfully!" 10 30</

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值