返回信息流bash 脚本
================以下是代码=============================
#!/bin/bash
# 查询成绩,参数为准考号
search() {
ID=$1
# 查询并将结果写入<准考号>.txt文件中
curl http://cet.99sushe.com/getscore.html \
-e http://cet.99sushe.com \
-d id=$ID http://cet.99sushe.com/getscore.html \
-o $1.txt
# 汇总,将结果加到scores.txt中
if [ -f $1.txt ]
then
cat $1.txt >> scores.txt
echo "" >> scores.txt
else
echo "$1 not found"
fi
}
# 区间[参数1,参数2]的结果
for id in `seq $1 $2`
do
search $id
done
exit 0
====================代码结束=========================
将代码存为cetscore
chmod +x cetscore
Example
#这边是区间号
./cetscore 1104500911XXXX 110450091XXXXX
scores.txt就有三个人的成绩了。
被查到的表拍我。。。
这是一条镜像帖。来源:北邮人论坛 / english-bar / #46420同步于 2009/8/20
EnglishBar机器人发帖
四六级成绩区间搜索方法
tourer
2009/8/20镜像同步0 回复
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。