Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   OT: use bash instead of ksh as prime shell (http://www.linux-archive.org/debian-user/580950-ot-use-bash-instead-ksh-prime-shell.html)

T o n g 09-28-2011 02:50 AM

OT: use bash instead of ksh as prime shell
 
Hi,

[This is not strictly related with Debian, but...]

I want to know what's the best way to use bash as my prime shell instead
of ksh, given the fact that changing the shell as system level is out of
the problem.

The problem is, unlike bash which has its own .bash_profile, ksh relies
strictly on .profile, which is share across sh/ksh/bash. I can't find a
way to start bash as a login shell from within .profile?

Any way around it?

Thanks

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: j5u219$bqj$1@dough.gmane.org">http://lists.debian.org/j5u219$bqj$1@dough.gmane.org


Wed Sep 28 06:30:01 2011
Return-path: <bounce-debian-user=tom=linux-archive.org@lists.debian.org>
Envelope-to: tom@linux-archive.org
Delivery-date: Wed, 28 Sep 2011 05:42:36 +0300
Received: from liszt.debian.org ([82.195.75.100]:51878)
by s2.java-tips.org with esmtps (TLSv1:AES256-SHA:256)
(Exim 4.69)
(envelope-from <bounce-debian-user=tom=linux-archive.org@lists.debian.org>)
id 1R8k6W-000691-CE
for tom@linux-archive.org; Wed, 28 Sep 2011 05:42:36 +0300
Received: from localhost (localhost [127.0.0.1])
by liszt.debian.org (Postfix) with QMQP
id 4E5DF13A46CD; Wed, 28 Sep 2011 02:51:09 +0000 (UTC)
Old-Return-Path: <mkt.cadastros@hotmail.com>
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on liszt.debian.org
X-Spam-Level: **
X-Spam-Status: No, score=2.4 required=4.0 tests=FORGED_HOTMAIL_RCVD2,FOURLA,
MONEY,RDNS_NONE,STOCKLIKE,X_PRIORITY_HIGH autolearn=no version=3.2.5
X-Original-To: lists-debian-user@liszt.debian.org
Delivered-To: lists-debian-user@liszt.debian.org
Received: from localhost (localhost [127.0.0.1])
by liszt.debian.org (Postfix) with ESMTP id B95A713A6678
for <lists-debian-user@liszt.debian.org>; Wed, 28 Sep 2011 02:33:16 +0000 (UTC)
X-Virus-Scanned: at lists.debian.org with policy bank en-ht
X-Amavis-Spam-Status: No, score=4.232 tagged_above=-10000 required=5.3
tests=[BAYES_80=1, FORGED_HOTMAIL_RCVD2=1.502, FOURLA=0.1, MONEY=0.5,
RDNS_NONE=0.1, STOCKLIKE=1, UNWANTED_LANGUAGE_BODY=0.03] autolearn=no
Received: from liszt.debian.org ([127.0.0.1])
by localhost (lists.debian.org [127.0.0.1]) (amavisd-new, port 2525)
with ESMTP id tUIq1Ob61J-9 for <lists-debian-user@liszt.debian.org>;
Wed, 28 Sep 2011 02:33:09 +0000 (UTC)
X-policyd-weight: using cached result; rate: 2.2
X-Greylist: delayed 4512 seconds by postgrey-1.31 at liszt; Wed, 28 Sep 2011 02:32:59 UTC
Received: from gcbrec061.civ.com.br (unknown [200.209.111.3])
by liszt.debian.org (Postfix) with SMTP id 55DCA13A6481
for <debian-user@lists.debian.org>; Wed, 28 Sep 2011 02:32:53 +0000 (UTC)
Received: from L-VAIO (unknown [189.110.243.53])
by gcbrec061.civ.com.br (Postfix) with ESMTP id 9F54FBDC49;
Tue, 27 Sep 2011 21:04:49 -0300 (BRT)
From: =?ISO-8859-1?Q?VENDE-SE:?= Cadastros de E-Mails
=?ISO-8859-1?Q?Esot�co?= & =?ISO-8859-1?Q?Hol�ico? <mkt.cadastros@hotmail.com>
Subject: VENDE-SE: Cadastros de E-Mails =?ISO-8859-1?Q?Esot�co?= &
=?ISO-8859-1?Q?Hol�ico?To: debian-user@lists.debian.org
Content-Type: text/plain
Reply-To: mkt.cadastros@hotmail.com
Disposition-Notification-To: mkt.cadastros@hotmail.com
Date: Tue, 27 Sep 2011 21:04:55 -0300
X-Priority: 1
Message-Id: <20110928023259.55DCA13A6481@liszt.debian.org>
X-Rc-Spam: 2008-11-04_01
X-Rc-Virus: 2007-09-13_01
X-Rc-Spam: 2008-11-04_01
Resent-Message-ID: <pcu3NdASv5J.A.tbC.duogOB@liszt>
Resent-From: debian-user@lists.debian.org
X-Mailing-List: <debian-user@lists.debian.org> archive/latest/613420
X-Loop: debian-user@lists.debian.org
List-Id: <debian-user.lists.debian.org>
List-Post: <mailto:debian-user@lists.debian.org>
List-Help: <mailto:debian-user-request@lists.debian.org?subject=help>
List-Subscribe: <mailto:debian-user-request@lists.debian.org?subject=subscribe>
List-Unsubscribe: <mailto:debian-user-request@lists.debian.org?subject=unsubscribe>
Precedence: list
Resent-Sender: debian-user-request@lists.debian.org
Resent-Date: Wed, 28 Sep 2011 02:51:09 +0000 (UTC)

VENDE-SE: Cadastros de E-Mails Esot�co & Hol�ico



A Base de Dados de Cadastros (Terapias Alternativas e Complementares), adquiridos com Profissionais (Terapeutas e Psico-Terapeutas) e em Listas de Discuss� est�egmentada endere� de e-mails e conta com 900 mil cadastros.



�serva� I: PROGRAMA DE ENVIO + SERVIDOR = GR�IS


�serva� II: INVESTIMENTO �ICO R$ 90,00


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/20110928023259.55DCA13A6481@liszt.debian.org

Bob Proulx 09-28-2011 04:04 AM

OT: use bash instead of ksh as prime shell
 
T o n g wrote:
> I want to know what's the best way to use bash as my prime shell instead
> of ksh, given the fact that changing the shell as system level is out of
> the problem.

You can't change /etc/profile? No 'chsh' command? Okay.

> The problem is, unlike bash which has its own .bash_profile, ksh relies
> strictly on .profile, which is share across sh/ksh/bash. I can't find a
> way to start bash as a login shell from within .profile?
>
> Any way around it?

When experimenting with shells and modifying your .profile *always*
keep a second terminal open and available to correct an editing
mistake. A mistake modifying your login files may prevent you from
logging into your shell. Always test your modifications and always
have a way to take corrective action that is independent of logging in
using the new modifications. As an alternative 'sftp' would also
allow you to access your files (to move them out of the way) without
logging in with a shell and may also provide you with a safety backup
access mechanism.

A second warning to keep in mind is that if you exec a script that
mistakenly execs itself it is very easy to create a fork-bomb. It is
well known that Linux kernels do not deal well with fork-bombs. As a
habit I always 'exec' only fully specified paths.

In your ~/.profile put this:

if [ -z "$BASH_VERSION" ]; then
export SHELL=/bin/bash
exec /bin/bash -l
fi

The 'exec' kills the current process, it dies, and overlays it with
the specified program.

Bob

T o n g 10-01-2011 03:13 PM

OT: use bash instead of ksh as prime shell
 
Thanks a lot Bob for your comprehensive explanation and nice solution.

On Tue, 27 Sep 2011 22:04:11 -0600, Bob Proulx wrote:

> When experimenting with shells and modifying your .profile *always* keep
> a second terminal open . . .

So true, lesson learned the hard way. :-)

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: j67anl$los$1@dough.gmane.org">http://lists.debian.org/j67anl$los$1@dough.gmane.org


All times are GMT. The time now is 07:46 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.