From owner-freebsd-questions@FreeBSD.ORG Fri Nov 26 11:57:42 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 064AE16A4CE for ; Fri, 26 Nov 2004 11:57:42 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 209F843D31 for ; Fri, 26 Nov 2004 11:57:39 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226])iAQBvWWe025119; Fri, 26 Nov 2004 13:57:32 +0200 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) iAQBvVsO016201; Fri, 26 Nov 2004 13:57:31 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost)iAQBvVmm016196; Fri, 26 Nov 2004 13:57:31 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 26 Nov 2004 13:57:31 +0200 From: Giorgos Keramidas To: "Conrad J. Sabatier" Message-ID: <20041126115731.GB1768@orion.daedalusnetworks.priv> References: <41A615CE.6010405@Silver-Lynx.com> <1101405587.63632.10.camel@dolphin.local.net> <20041125173018.0444d52c@dolphin.local.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041125173018.0444d52c@dolphin.local.net> cc: freebsd-questions@freebsd.org cc: Don Wilde Subject: Re: shell programming challenge X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2004 11:57:42 -0000 On 2004-11-25 17:30, "Conrad J. Sabatier" wrote: > > OK, I think I've found what you're looking for: > > xterm -e "/usr/local/bin/bash --rcfile bash_commands -i" > > Substitute your program's startup script for "bash_commands" in the > above. Using the "-i" switch to bash forces interactive mode, so when > the script exits, you'll be returned to the shell prompt in the xterm. > As it turns out, xterm's "-hold" switch is wholly unnecessary here. > > Note that the "--rcfile" switch, being a "double-hyphened" option, must > precede the later "-i" switch in order to be recognized. Cool trick! I was thinking something like adding the following to the local .bashrc: [-- .bashrc --] if [ ! X"${BASHRC_LOCAL}" = X"" ] && \ [ -r "${BASHRC_LOCAL}" ]; then . "${BASHRC_LOCAL}" fi Then running xterm with BASHRC_LOCAL set to the path of the local bash script: BASHRC_LOCAL="/path/foo" xterm -e bash --rcfile is better though :-)