Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

(unix) Change execution terminal/console

Status
Not open for further replies.

unukalhai

Technical User
Apr 17, 2002
4
ES
Hi guys!

I work in an Ultra 5 Solaris 2.7. (tlc/tk 8.0)
Here is my question...

I want to "exec" a program in a terminal/console different from the one where I have run my Tcl script. The reason is to don not mix the traces of different programs in the same terminal/console.

How can I do that?. Is it posible?

Thanks in advance.

:)


 
If you are running wish rather than tclsh
and xauth is set up so that "send" will work,
then perhaps you could do this:

- run "wish" in the other terminal or
console.

- note the appname of it - do "winfo name ."
to find out. It will be either wish or
"wish #2", "wish #3" etc.

- to exec a program in this wish from
another wish, and make the output appear
in this wish:

send <appname> { puts [exec <cmd>] }

 
Are you familiar with expect and are you using *nix
as your development target? If so there is a couple
ways to do what you want: the simplest being
exec xterm -e programname of course, the others involving
expect.
You have tried this?
 
Thanks a lot, marsd and crossrad.

I'll try both of the solutions.

Greetings.
 
Keep in mind that if you use Tcl's exec command to execute another program, the output of that program isn't displayed on the terminal. If you don't tell exec to redirect the output, the output is &quot;captured&quot; by Tcl, and it becomes the return value of the exec command. On the other hand, you can tell exec to redirect the program's output using I/O redirection syntax similar to most Unix shells. For example:

[tt]exec od myfile > anotherfile.dump[/tt]

Of course, if you don't redirect the program's output and you run exec from an interative tclsh or wish, you see the output displayed, but only because Tcl displays the return value of each command executed when you run an interactive shell. - Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top