测试打字速度的脚本

sh/bash/dash/ksh/zsh等Shell脚本
回复
zodiac207
帖子: 5
注册时间: 2009-08-28 15:30

测试打字速度的脚本

#1

帖子 zodiac207 » 2011-06-30 15:56

这是一个测试打字速度的脚本,原创不是我,但这个脚本还是比较好玩的。
代码如下:

代码: 全选

#!/bin/sh
# speed.sh: a very tiny utility to measure typing speed.
prompt="Start typing a piece of text. Press Ctrl-d twice to finish."
echo "\n$prompt \n"
start_time=`date +%s`
words=`cat|wc -w`
end_time=`date +%s`
speed=`echo "scale=2; $words / (($end_time - $start_time) / 60)" | bc`
echo "\n\nYou have a typing speed of $speed words per minute."
图片
头像
be00
帖子: 805
注册时间: 2008-07-28 19:51
来自: 长沙
联系:

Re: 测试打字速度的脚本

#2

帖子 be00 » 2011-06-30 23:20

这个脚本挺简单,可以改装成更好玩的
我的乌斑兔儿:http://zhanggang.net/m/b/b1/ubuntu右键选择在新的窗体打开
右边有一只黄手 ----> 或者注册Dropbox中文版感谢我
回复