@@ -303,7 +303,7 @@ isNaturalNumber "$update_count" || die "update count($update_count) is not a nat
303
303
readonly update_count
304
304
305
305
if [ -n " $pid_list " ]; then
306
- pid_list=${pid_list// [[:space:]]} # delete white space
306
+ pid_list=${pid_list// [[:space:]]/ } # delete white space
307
307
isNaturalNumberList " $pid_list " || die " pid(s)($pid_list ) is illegal! example: 42 or 42,99,67"
308
308
fi
309
309
readonly pid_list
@@ -562,6 +562,7 @@ printStackOfThreads() {
562
562
}
563
563
}
564
564
565
+ (( idx > 1 )) && normalOutput
565
566
blueOutput " [$idx ] Busy($pcpu %) thread($threadId /$threadId0x ) stack of java process($pid ) under user($user ):"
566
567
567
568
if [ -n " $mix_native_frames " ]; then
@@ -579,10 +580,7 @@ printStackOfThreads() {
579
580
/^$/d; p # delete end separator line
580
581
}"
581
582
fi
582
- {
583
- sed " $sed_script " -n -r " $jstackFile "
584
- echo
585
- } | tee ${append_file: +-a " $append_file " } ${store_dir: +-a " $store_file_prefix$PROG " }
583
+ sed " $sed_script " -n -r " $jstackFile " | tee ${append_file: +-a " $append_file " } ${store_dir: +-a " $store_file_prefix$PROG " }
586
584
done
587
585
}
588
586
@@ -594,7 +592,10 @@ main() {
594
592
local update_round_num
595
593
# if update_count <= 0, infinite loop till user interrupted (eg: CTRL+C)
596
594
for (( update_round_num = 0 ; update_count <= 0 || update_round_num < update_count; ++ update_round_num)) ; do
597
- (( update_round_num > 0 )) && sleep " $update_delay "
595
+ (( update_round_num > 0 )) && {
596
+ sleep " $update_delay "
597
+ normalOutput
598
+ }
598
599
599
600
[[ -n " $append_file " || -n " $store_dir " ]] && headInfo |
600
601
tee ${append_file: +-a " $append_file " } ${store_dir: +-a " $store_file_prefix$PROG " } > /dev/null
0 commit comments