setarch: use a login shell; fixes #12066.

* This also updates /etc/profile to detect whether our
  parent process is a shell, and changes the banner
  message accordingly.
* Also, pipe errors to /dev/null, in case grep is not
  installed; this allows us to not require grep as a
  dependency, and let the banner message do the right
  thing.
This commit is contained in:
Jessica Hamilton
2015-06-12 19:29:19 +12:00
parent ea54368ece
commit 0975f16f7c
2 changed files with 10 additions and 4 deletions
+6 -1
View File
@@ -3,7 +3,12 @@
# Place user customizations in /.profile
#
echo -e "\nWelcome to the Haiku shell.\n"
ps |& grep -e $PPID |& grep -e $SHELL |& grep -q -e $PPID > /dev/null 2>&1
if [ $? -eq 1 ] ; then
echo -e "\nWelcome to the Haiku shell.\n"
else
echo -e "\nSwitching to architecture `getarch`\n"
fi
export USER=`id -un`
export GROUP=`id -gn`