From e4fac182002018b5bdad5c478aa80d1b845a05ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 21 Aug 2018 23:24:15 +0200 Subject: [PATCH] data/profile: fix and simplify secondary arch detection The previous code was wrong: running bash --login was reported as if we used setarch x86_gcc2. Current code also saves 3 fork+exec. --- data/etc/profile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/data/etc/profile b/data/etc/profile index f9de4feaf9..423dfd6a02 100644 --- a/data/etc/profile +++ b/data/etc/profile @@ -3,14 +3,15 @@ # Place user customizations in /.profile # -ps 2>&1 | grep -e $PPID 2>&1 | grep -e $SHELL 2>&1 | grep -q -e $PPID > /dev/null 2>&1 -if [ $? -eq 1 ] ; then +ARCH=`getarch 2>/dev/null` +if [ "$ARCH" = "`getarch -p 2>/dev/null`" ] ; then echo -e "\nWelcome to the Haiku shell.\n" export PS1="\w> " else echo -e "\nSwitching to architecture `getarch`\n" - export PS1="[`getarch`] \w> " + export PS1="[$ARCH] \w> " fi +unset ARCH export USER=`id -un` export GROUP=`id -gn`