From owner-freebsd-questions@FreeBSD.ORG  Thu Nov 25 22:10:45 2004
Return-Path: <owner-freebsd-questions@FreeBSD.ORG>
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 E9E4016A4CE
	for <freebsd-questions@freebsd.org>;
	Thu, 25 Nov 2004 22:10:45 +0000 (GMT)
Received: from lakermmtao01.cox.net (lakermmtao01.cox.net [68.230.240.38])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6490443D3F
	for <freebsd-questions@freebsd.org>;
	Thu, 25 Nov 2004 22:10:45 +0000 (GMT)	(envelope-from conrads@cox.net)
Received: from dolphin.local.net ([68.11.30.24]) by lakermmtao01.cox.net
          (InterMail vM.6.01.04.00 201-2131-117-20041022) with ESMTP
          id <20041125221043.BJV29295.lakermmtao01.cox.net@dolphin.local.net>;
          Thu, 25 Nov 2004 17:10:43 -0500
Received: from dolphin.local.net (localhost.local.net [127.0.0.1])
	by dolphin.local.net (8.13.1/8.13.1) with ESMTP id iAPMAiAS073686;
	Thu, 25 Nov 2004 16:10:44 -0600 (CST)
	(envelope-from conrads@dolphin.local.net)
Received: (from conrads@localhost)
	by dolphin.local.net (8.13.1/8.13.1/Submit) id iAPMAWAD073685;
	Thu, 25 Nov 2004 16:10:32 -0600 (CST)
	(envelope-from conrads)
From: "Conrad J. Sabatier" <conrads@cox.net>
To: Don Wilde <Don@Silver-Lynx.com>
In-Reply-To: <41A615CE.6010405@Silver-Lynx.com>
References: <41A615CE.6010405@Silver-Lynx.com>
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
X-Evolution-Format: text/plain
X-Evolution-Account: conrads@cox.net
X-Evolution-Transport: smtp://conrads@localhost
X-Evolution-Fcc: email://local@local/Sent
Organization: A Rag-Tag Band of Drug-Crazed Hippies
X-Mailer: Evolution 2.0.2 FreeBSD GNOME Team Port 
Date: Thu, 25 Nov 2004 11:59:47 -0600
Message-Id: <1101405587.63632.10.camel@dolphin.local.net>
Mime-Version: 1.0
X-Evolution: 0000000c-0010
cc: freebsd-questions@freebsd.org
Subject: Re: shell programming challenge
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
Reply-To: conrads@cox.net
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>,
	<mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions>
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>,
	<mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 25 Nov 2004 22:10:46 -0000

On Thu, 2004-11-25 at 10:26 -0700, Don Wilde wrote:
> Hey, folks -
> 
> I need to find a way to kick off an xterm running BASH and then execute 
> a program within that xterm, but NOT close the new xterm after the 
> program finishes. Another desirable thing would be to also be able to 
> 'source in' a file of shell environment that would affect the new window 
>   and shell.
> 
> Here's what I've found out so far:
> 
> Assume we have an executable test file 'ticktock':
> 
> #!/bin/sh
> for n in 1 2 3 4 5 6 7 8
> do
>    echo "$n MYVAR=$MYVAR"
>    sleep 1
>    echo -n "continue? "
>    read reply
> done
> # end of ticktock
> 
> I want to do something like:
> 
> xterm -e bash <(echo ./ticktock) &
> 
> When I do this, the program works & interacts, but the xterm dies upon 
> completion of ticktock or INT. I also do not seem to be able to use the 
> --rcfile switch as a bash option, although I can add KEY=VALUE pairs 
> before the xterm launch.
> 
> Ideas? Please respond to me directly.

man xterm.  There *is* an option to keep the term open after executing a
program.

-- 
Conrad J. Sabatier -- conrads@cox.net -- "In Unix veritas"