aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadu Ciorba <[email protected]>2017-08-12 02:21:27 +0300
committerRadu Ciorba <[email protected]>2017-08-12 02:21:27 +0300
commit69d3c0f1f24d58b3a7327ce15ba1e23e8a01e3f3 (patch)
tree47a44393da5c3415acd4569d9615a4556135d458
parent1a1b11f4304dc7b9e3e9e86ac8680d9997fc01ff (diff)
downloadkerl-69d3c0f1f24d58b3a7327ce15ba1e23e8a01e3f3.tar.gz
kerl-69d3c0f1f24d58b3a7327ce15ba1e23e8a01e3f3.tar.bz2
kerl-69d3c0f1f24d58b3a7327ce15ba1e23e8a01e3f3.zip
avoid PPID since it's used and readonly on mac + use ps -o ucomm
PPID variable already used and readonly on Mac. ps's output flag comm is not consistent between Mac and Linux+FreeBDS, but ucomm seems to work everywhere
-rwxr-xr-xkerl4
1 files changed, 2 insertions, 2 deletions
diff --git a/kerl b/kerl
index 9e9d55c..034c341 100755
--- a/kerl
+++ b/kerl
@@ -933,8 +933,8 @@ ACTIVATE_CSH
fi
PID=$$
- PPID=$(ps -p $PID -o ppid | grep -E "[0-9]+" -o)
- PARENT_CMD=$(ps -p $PPID -o comm | tail -n 1)
+ PARENT_PID=$(ps -p $PID -o ppid | grep -E "[0-9]+" -o)
+ PARENT_CMD=$(ps -p $PARENT_PID -o ucomm | tail -n 1)
case "$PARENT_CMD" in
fish)
SHELL_SUFFIX=".fish"