http://openobject.com/wiki/index.php/Developers:Developper's_Book/
Thursday, July 28, 2011
Friday, July 15, 2011
Count your typing speed in Linux
Tools
- bash shell (obvious)
- wc (Linux utility command, counts the number of words)
- cat (To get the user input)
- date +%s (time since 1970 in number of seconds elapsed)
- | (pipe to insert the output to the wc utility)
- start=date +%s note the current time.
- cat | wc -w (now start typing)
- do ctrl+d to stop typing
- stop=date +%s note the stop time.
- calculate:(cat | wc -w)*60/(stop-stop)
We get the typing speed per minute!
(Now its obvious that these command should be in the script)
(Now its obvious that these command should be in the script)
Subscribe to:
Posts (Atom)