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 1111readonly PROG=" ` basename $0 ` "
1212readonly -a COMMAND_LINE=(" $0 " " $@ " )
1313
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+
1420# Get corrent current user name via whoami command
1521# See get https://www.lifewire.com/current-linux-user-whoami-command-3867579
1622# Because if use `sudo -u` to run command, env var $USER is not rewrited/correct, just inherited from outside!
@@ -187,7 +193,7 @@ printStackOfThreads() {
187193 }
188194
189195 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 " }
191197 done
192198}
193199
You can’t perform that action at this time.
0 commit comments