#!/bin/bash
clear
# While some condition is true (I always tend to use data command)
while date > /dev/null
do
# Seconds is a bash variable which will give the number of seconds since
# the shell invocation. If a value is assigned to SECONDS, the value
# returned upon subsequent references is the number of seconds since
# the assignment plus the value assigned. "man bash" for more details
SECONDS=0
# Something to pause the execution
read pause_var
echo " $SECONDS Secs"
done
I press enter to know the lap time.
BASH has so many such surprises in it, I wonder how much more still needs to be discovered.
No comments:
Post a Comment