Hi all,
I'm fairly new to Linux and Bash so if I appear slow that's the reason
I'm trying to write a function in Bash that will give me the time it takes to do an operation and then report to a logfile if it passes or fails. What I have so far is;
functionName()
{
echo Timing the operation. >> $LOG
date
$OPERATION
date
}
but this means I will manually have to calculate the difference between the two dates. Can i have something like;
if
difference between dates <5seconds
echo fail
fi
??
Thanks in advance,
Matthew.