This is a shell script that acts as a stopwatch. It outputs the elapsed time in hours, minutes, and seconds since the script was started. When the script is stopped by pressing Ctrl + C, it uses the “say” command to speak the elapsed time out loud.
#!/bin/bash
function finish {
hours=$((elapsed / 3600))
minutes=$(((elapsed % 3600) / 60))