File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 11
11
readonly PROG=" ` basename $0 ` "
12
12
readonly -a COMMAND_LINE=(" $0 " " $@ " )
13
13
14
+ # Check os support!
15
+ uname | grep ' ^Linux' -q || {
16
+ echo " $PROG only support Linux, not support ` uname` yet!" 1>&2
17
+ exit 2
18
+ }
19
+
14
20
# Get corrent current user name via whoami command
15
21
# See get https://www.lifewire.com/current-linux-user-whoami-command-3867579
16
22
# Because if use `sudo -u` to run command, env var $USER is not rewrited/correct, just inherited from outside!
@@ -187,7 +193,7 @@ printStackOfThreads() {
187
193
}
188
194
189
195
bluePrint " [$(( counter++ )) ] Busy(${pcpu} %) thread(${threadId} /${threadId0x} ) stack of java process(${pid} ) under user(${user} ):"
190
- sed " /nid=${threadId0x} /,/^$/p" -n ${jstackFile} | tee ${append_file+-a " $append_file " }
196
+ sed " /nid=${threadId0x} /,/^$/p" -n ${jstackFile} | tee ${append_file: +-a " $append_file " }
191
197
done
192
198
}
193
199
You can’t perform that action at this time.
0 commit comments