You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-s, --jstack-path <path> specify the path of jstack command
38
37
-F, --force set jstack to force a thread dump(use jstack -F option)
39
38
-h, --help display this help and exit
40
-
delay the delay between updates in seconds.
41
-
count the number of updates.
42
-
the usage of delay/count imitates vmstat
39
+
delay the delay between updates in seconds
40
+
count the number of updates
41
+
delay/count arguments imitates style of vmstat command
43
42
EOF
44
43
45
44
exit$1
@@ -124,7 +123,7 @@ normalPrint() {
124
123
}
125
124
126
125
if [ -n"$jstack_path" ];then
127
-
! [-x"$jstack_path" ] && {
126
+
[ !-x"$jstack_path" ] && {
128
127
redPrint "Error: $jstack_path is NOT found/executalbe!"1>&2
129
128
exit 1
130
129
}
@@ -136,11 +135,11 @@ else
136
135
redPrint "Error: jstack not found on PATH! Use -s option set jstack path manually."1>&2
137
136
exit 1
138
137
}
139
-
! [-f"$JAVA_HOME/bin/jstack" ] && {
138
+
[ !-f"$JAVA_HOME/bin/jstack" ] && {
140
139
redPrint "Error: jstack not found on PATH and \$JAVA_HOME/bin/jstack($JAVA_HOME/bin/jstack) file does NOT exists! Use -s option set jstack path manually."1>&2
141
140
exit 1
142
141
}
143
-
! [-x"$JAVA_HOME/bin/jstack" ] && {
142
+
[ !-x"$JAVA_HOME/bin/jstack" ] && {
144
143
redPrint "Error: jstack not found on PATH and \$JAVA_HOME/bin/jstack($JAVA_HOME/bin/jstack) is NOT executalbe! Use -s option set jstack path manually."1>&2
145
144
exit 1
146
145
}
@@ -210,5 +209,5 @@ for ((i = 0; update_count <= 0 || i < update_count; ++i)); do
210
209
[ -z"${pid}" ] &&
211
210
awk '$4=="java"{print $0}'||
212
211
awk -v "pid=${pid}"'$1==pid,$4=="java"{print $0}'
213
-
} | sort -k5 -r -n | head --lines"${count}"| printStackOfThreads
212
+
} | sort -k5 -r -n | head -n"${count}"| printStackOfThreads
0 commit comments