aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xkerl5
1 files changed, 3 insertions, 2 deletions
diff --git a/kerl b/kerl
index a005976..540f4f5 100755
--- a/kerl
+++ b/kerl
@@ -1114,8 +1114,9 @@ ACTIVATE_CSH
fi
PID=$$
- PARENT_PID=$(ps -p $PID -o ppid | grep -E "[0-9]+" -o)
- PARENT_CMD=$(ps -p "$PARENT_PID" -o ucomm | tail -n 1)
+ PARENT_PID=$(ps -p $PID -o ppid=) || exit 1
+ # shellcheck disable=SC2086
+ PARENT_CMD=$(ps -p $PARENT_PID -o ucomm | tail -n 1)
case "$PARENT_CMD" in
fish)
SHELL_SUFFIX=".fish"