Skip to content
Snippets Groups Projects
Commit 36fe312a authored by nimrod's avatar nimrod
Browse files

__run_duration returns 0 when it can't calculate the command run duration...

__run_duration returns 0 when it can't calculate the command run duration (when the shell doesn't have support for PS0, like ksh).
parent e11e6774
No related branches found
No related tags found
No related merge requests found
...@@ -211,12 +211,16 @@ match_ssl_pair () { ...@@ -211,12 +211,16 @@ match_ssl_pair () {
} }
__run_duration () { __run_duration () {
# Assumes that $HOME/.prerun.$$ exists. if [ -f "$HOME/.prerun.$$" ]
then
local endtime starttime local endtime starttime
endtime="$(date +%s)" endtime="$(date +%s)"
starttime="$(cat "$HOME/.prerun.$$")" starttime="$(cat "$HOME/.prerun.$$")"
rm "$HOME/.prerun.$$" rm "$HOME/.prerun.$$"
echo "$(( endtime - starttime ))" echo "$(( endtime - starttime ))"
else
echo 0
fi
} }
__prerun () { __prerun () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment