From 0b848fac27fe1bc48f08c0fc3519c16851c9988d Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Thu, 21 Oct 2021 05:33:50 +0000 Subject: [PATCH] bash: set PCMD only if /proc available --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 6fbecbb..cb23e73 100644 --- a/.bashrc +++ b/.bashrc @@ -170,7 +170,7 @@ case "$TERM" in ;; esac # bash complains if $() faces null -PCMD=$(tr -d '\000' < /proc/$PPID/cmdline) +[ -f "/proc/$PPID/cmdline" ] && PCMD=$(tr -d '\000' < /proc/$PPID/cmdline) [ -z "$PTERM" ] && INITLVL=1 PTERM=${PTERM:-$TERM/} case "$PCMD" in -- 2.45.2