We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc74986 commit 90ef9f5Copy full SHA for 90ef9f5
functions/process/pstree2.sh
@@ -7,7 +7,6 @@
7
# Create Date: 2021/5/10
8
# Create Time: 22:24
9
10
-
11
#if [ "$(id -u)" != "0" ]; then
12
# echo "WARNING: This script should be run as root" 2>&1
13
#fi
@@ -26,8 +25,8 @@ ps -ef | grep "$current_pid_grep" | awk -v pid="$current_pid" '$2==pid' | grep "
26
25
current_ppid="$(ps -ef | grep "$current_pid_grep" | awk -v ppid="$current_pid" '$2==ppid {print $3}')"
27
28
if [[ "$current_ppid" == "" || "$current_ppid" == "0" ]]; then
29
- echo "the pid not exists."
30
- exit 1
+ echo "the pid not exists."
+ exit 1
31
fi
32
33
while [[ $current_ppid -ne 1 ]]; do
@@ -41,4 +40,4 @@ while [[ $current_ppid -ne 1 ]]; do
41
40
if [[ $current_ppid -eq 1 ]]; then
42
break
43
44
-done
+done
0 commit comments