home Mail List
Info
Info
Meetings
Goals
Upcoming
Projects
FAQ
Security
Links

[Date Prev][Date Next] [Chronological] [Thread] [Top]

[NMLUG] programming challenge



Aaron Birenboim wrote:
> On Wed, 2004-11-24 at 15:17, Don Wilde wrote:
> 
>>Hey, all -
>>
>>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 desireable thing would be to also be able to 
>>'source in' a file of shell environment that would affect the new window 
>>  and shell.
> 
> 
> I have done this.
> The bad news is that I wrote something like
> the inverse of tee to do it.
> 
> Doing it inside another xterm is even more tricky.
> 
> If you are root, you can write directly to the tty to
> send commands.  This would be the easiest route... if possible.
> 
> Otherwise, start up bash, forking from a program that
> retains ownership of the child's stdin.
> This program can do a select/poll for input on
> its stdin, which it will pass to bash, all while
> occationally printing a command of its own choosing
> to bash.... or taking that command from a socket,
> or named pipe.
> 
xterm -e bash --rcfile file -i -c "prog args && exec bash" &

did what I needed. As long as your .bashrc doesn't clobber the PATH et 
al, the environment stays preserved in the second shell, which is what I 
wanted.

-- 
Don Wilde  ---------> Silver Lynx <----------
  Raising the Trajectory of Human Development
---------------------------------------------
          http://www.Silver-Lynx.com




Please send sugestions and comments to webmaster@nmlug.org.
Valid XHTML 1.1! Valid CSS! Powered by Debian Powered by Apache