Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Nov 2004 11:59:47 -0600
From:      "Conrad J. Sabatier" <conrads@cox.net>
To:        Don Wilde <Don@Silver-Lynx.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: shell programming challenge
Message-ID:  <1101405587.63632.10.camel@dolphin.local.net>
In-Reply-To: <41A615CE.6010405@Silver-Lynx.com>
References:  <41A615CE.6010405@Silver-Lynx.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1101405587.63632.10.camel>