Skip to content

Commit

Permalink
Issue with caller capturing value of checkTimeLimit bash function
Browse files Browse the repository at this point in the history
Issue 1394:

Resolve #1394
  • Loading branch information
wwlwpd committed Sep 22, 2024
1 parent 5dbb223 commit 32c2a01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions asgs_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1123,8 +1123,8 @@ checkTimeLimit()
{
THIS="asgs_main.sh>checkTimeLimit()"
if [[ -z "$1" || -z "$2" ]]; then
warn "$ENSTORM: $THIS: One or both parameters for checkTimeLimit() is empty. STARTTIME='$1', TIMELIMIT='$2'."
return 0
warn "$ENSTORM: $THIS: One or both parameters for checkTimeLimit() is empty. STARTTIME='$1', TIMELIMIT='$2'." >&2
echo 0
fi
STARTTIME=$1
TIMELIMIT=$2
Expand All @@ -1146,9 +1146,9 @@ checkTimeLimit()
format="%02d:%02d:%02d"
hms=$(printf "$format" $hoursEnd $minutesEnd $secondsEnd)
warn "$ENSTORM: $THIS: The time limit is $TIMELIMIT but the total time used so far is $hms. Therefore, the time limit has been exceeded."
return 1
echo 1
else
return 0
echo 0
fi
}
#
Expand Down

0 comments on commit 32c2a01

Please sign in to comment.