Skip to content

Commit d277231

Browse files
committed
fix bug for limit function.
1 parent ec3a145 commit d277231

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bashrc/threads.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ TMPFILE="pipe.$$"
1616
SSH="ssh -n -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o ConnectTimeout=5 "
1717
SCP='scp -q -r -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o ConnectTimeout=5 '
1818

19+
RET_OK=0
20+
RET_FAIL=1
21+
1922
##################### function #########################
2023
_report_err() { echo "${MYNAME}: Error: $*" >&2 ; }
2124

@@ -58,7 +61,7 @@ Notice:
5861
please check the result output under log/hostname.
5962
USAGE
6063

61-
exit 1
64+
exit $RET_OK
6265
}
6366

6467
#
@@ -170,10 +173,10 @@ do
170173
unset fchar
171174

172175
if [ "x$g_LIMIT" != "x0" ]; then
173-
if [ "$g_LIMIT" -le "$INDEX" ]; then
176+
if [ "$g_LIMIT" -lt "$INDEX" ]; then
174177
_trace "Reach limit num of $g_LIMIT"
175178
break
176-
fi
179+
fi
177180
fi
178181

179182
_trace "[$INDEX] start ${HOST} ......"

0 commit comments

Comments
 (0)