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:
+6
-1
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user