Skip to content

Commit 3de6dcc

Browse files
authored
Merge pull request #62 from xiongchen2012/master
执行脚本的用户名超过8个字符时无法执行脚本
2 parents 07d18e5 + 1b405e7 commit 3de6dcc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

show-busy-java-threads

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ for ((i = 0; update_count <= 0 || i < update_count; ++i)); do
237237
[ -n "$append_file" ] && headInfo >> "$append_file"
238238
[ "$update_count" -ne 1 ] && headInfo
239239

240-
ps -Leo pid,lwp,user,comm,pcpu --no-headers | {
240+
ps -Leo pid,lwp -o ruser=${USER} -o comm,pcpu --no-headers | {
241241
[ -z "${pid}" ] &&
242242
awk '$4=="java"{print $0}' ||
243243
awk -v "pid=${pid}" '$1==pid,$4=="java"{print $0}'

0 commit comments

Comments
 (0)