Help - Search - Members - Calendar
Full Version: Default Shell In Konsole
OESF Forums > General Forums > General Support and Discussion > Software
shturm
I've downloaded tcsh (as part of package armutils), and set it as my default shell (in /etc/passwd). When I connect to my Z via ssh, I can see that tcsh is indeed my default shell now.
However, when I start opie-embeddedkonsole, it still launches bash.
Is there a way to change this?
kakos
Create a file called ".profile" in your home directory. In it, put the path to your shell of choice (/usr/local/bin/tcsh for example). That worked for me.
gfdsa
QUOTE(kakos @ Apr 2 2005, 10:15 AM)
Create a file called ".profile" in your home directory.  In it, put the path to your shell of choice (/usr/local/bin/tcsh for example).  That worked for me.
*

that will spawn 2 shells, bash/sh and tcsh as child
MB Zaurus
QUOTE(gfdsa @ Apr 13 2005, 05:26 AM)
QUOTE(kakos @ Apr 2 2005, 10:15 AM)
Create a file called ".profile" in your home directory.  In it, put the path to your shell of choice (/usr/local/bin/tcsh for example).  That worked for me.
*

that will spawn 2 shells, bash/sh and tcsh as child
*



Yes, that will spawn 2 shells. It's also a bad idea (from the standpoint of *nix administration) to have root's .profile blindly call or exec another shell. If the system is corrupted and you need to boot into single-user mode to do disk recovery, you don't want a .profile that launches another shell.

Try the following script. Note that you'll need to change $MYSHELL, and you may want to eliminate the section where root's $HOME directory is reassigned. This is useful in a Solaris environment where root's home directory is /.


#################################################
/bin/echo "bash? [Y|n]\c"
read ans
if [ "X$ans" = "X" -o -z $ans -o "X$ans" = "Xy" -o "X$ans" = "XY" ] ; then
MYSHELL=/usr/bin/bash
if [ "$SHELL" != "$MYSHELL" ] ; then
MYSHELLCMD="-c" # option to run a single command
# bash -c
# [t]csh -e

MYSHELLLOGIN="--login" # otion to specify a login shell
# bash --login
# [t]csh -l

/bin/ls /tmp> /dev/null 2> /dev/null
# OK, the system isn't hosed... continue
if [ $? -eq 0 ] ; then
if [ -x $MYSHELL ] ; then
$MYSHELL $MYSHELLCMD "exit 0"
if [ $? -eq 0 ] ; then
# The shell was able to execute something
if [ -d /export/home/root ] ; then
HOME=/export/home/root ; export HOME
fi

if [ -d /home/root ] ; then
HOME=/home/root ; export HOME
fi

export MYSHELL
SHELL=$MYSHELL ; export SHELL
cd
echo "exec()ing $MYSHELL $MYSHELLLOGIN"
exec $MYSHELL $MYSHELLLOGIN
else
# If we get to here, then we couldn't start up
# the chosen shell...but we've still got /sbin/sh
# as our shell...

echo "Could not run $MYSHELL"
fi
fi
fi
fi
fi
#################################################

Mark
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2015 Invision Power Services, Inc.