文本处理实用工具与脚本应用
在日常的系统操作和数据处理中,文本处理是一项非常重要的工作。下面将介绍一些实用的文本处理工具和相关脚本的应用。
1. 奖品脚本与世界杯分组脚本
首先来看一个简单的奖品脚本示例,运行 prizes.sh 脚本可以输出各类奖项的获得者:
rm -f $temp
$ ./prizes.sh
The Gold prize goes to Emily
The Silver prize goes to Bethany
The Bronze prize goes to Christopher
There are three runners-up prizes. In alphabetical order, the winners are:
Anthony
Mary
Daniel
The booby prize goes to John. Bad luck John!
Congratulations to everybody who participated.
接下来是世界杯分组和赛程安排脚本。该脚本会将参赛队伍随机分组,并安排每组内的比赛。以下是 worldcup.sh 脚本的详细内容:
#!/bin/bash
function arrangegames
{
played=`mktemp`
grep -v “^*** Group “ /tmp/group${group} | while read team
do
#
超级会员免费看
订阅专栏 解锁全文
3621

被折叠的 条评论
为什么被折叠?



