1
0

avoid interaction with PID1

This commit is contained in:
Konstantin Demin 2021-04-07 15:51:49 +03:00
parent 04b31f7a24
commit a312de64e1
Signed by: krd
GPG Key ID: 1F33CB0BA4731BC6

View File

@ -10,6 +10,8 @@ function {
i=$(ps -o ppid= -p $i 2>/dev/null || : ) i=$(ps -o ppid= -p $i 2>/dev/null || : )
i=${i//[^0-9]} i=${i//[^0-9]}
[[ "$i" =~ '^[1-9][0-9]*$' ]] || break [[ "$i" =~ '^[1-9][0-9]*$' ]] || break
## don't deal with PID1
[ "$i" = 1 ] && continue
ZSHU_PARENTS_PID+=( $i ) ZSHU_PARENTS_PID+=( $i )
done done