Re: Alternative to EXEC

From: David Gravereaux (davygrvy_at_pobox.com)
Date: 05/10/04


Date: Mon, 10 May 2004 12:42:33 -0700

Niemann <jensniemann@gmx.de> wrote:

>Basically I have the following problem.
>exec rar.exe -a d:/nash c:/synchronize/*.*
>Why is this not running.
>I neither get an error message nor is anything happen.

Does that commandline work as-is from a command prompt? I ask because of the
path separator. Some apps don't like / (forward slash).

If you're calling this from Tk, some commandline apps are really console
applications that require a console to run in. Under Tk, no console is given
and applications such as telnet fail silently leaving the user to scratch their
head as to why it barfed:

% exec telnet
child killed: SIGABRT
(Tcl) 2 %

Notice that telnet gives us no error messages.

>BTW path substitution would be nice

Use the result of [glob]. If one changed Tcl so wildcards are expanded, I would
fear some dangerous consequences for backward compatibility.

Example:

C:\WINNT\system32>echo *
*

C:\WINNT\system32>tclsh85
% exec {expand}[auto_exe*** echo] *
*
%

It's the job of the application receiving the wildcards to do what it does with
them. In case of the shell's echo command, it does nothing.

% exec {expand}[auto_exe*** echo] {expand}[glob *.hlp]
atmenuxx.hlp cliconf.hlp cmmgr32.hlp COMMTB32.HLP doshelp.hlp DRVSSRVR.HLP edit.
hlp HPFLASH.HLP HPHCO.HLP HPJDUND.HLP HPJMON.HLP HPLOCMON.HLP HPLOT.HLP hpmon.hl
p HPMSTOR.HLP HPPRECL.HLP HPPRELK.HLP HPPRNTR.HLP hptcpmui.hlp JETADMIN.HLP MSCA
L.HLP net.hlp ODBCINST.HLP ODBCJET.HLP PINTLPAD.HLP prosetp.hlp sqlsodbc.hlp win
help.hlp
%

-- 
David Gravereaux <davygrvy@pobox.com>
[species: human; planet: earth,milkyway(western spiral arm),alpha sector]