Re: Execution of external commands



pn8830 wrote:
The only question I have is how to trigger
the unknown? For the example in my previous post just put:

eval $inp

This will cause an error because the variable "inp" does not exist.

lets try ( assumed the [unknown] proc exists as set up in the interactive
shell :

set inp "grep hanana [glob *.txt]"

eval $inp

will look for a proc named "grep". ( first token on the line )
This will not be found inside tcl which leads to unknown
being run with the complete line from $inp
as a list of arguments.

unknown then tries to find a system executable with
the name grep and execing that with the remaining args
attached.

notice there is no shell involved, so you will have to
do wildcard expansion on your own ( or change unknown
in such a way that it runs the command in a subshell.

uwe

.



Relevant Pages

  • Re: lambda... again
    ... regular proc. ... proc unknown args $what\n ... lambdas is going to be annoying: ... global print;# typing global all the time quickly gets annoying ...
    (comp.lang.tcl)
  • Re: NULL = NULL not working
    ... >>I have a proc that can specify a price range if its passed in. ... Think of NULL as an unknown value. ...
    (microsoft.public.sqlserver.mseq)
  • Re: passing the result list of a command to a proc
    ... | Because I thought that that's what I was doing: passing an unknown ... argument to the proc, and iterate over the elements of the list. ... | I have defined a new command which sends a SCSI command to a device ... e.g. the mode pages received from a MODE SENSE command. ...
    (comp.lang.tcl)
  • User domainautodl not recognized by AutoDL
    ... specified the user name and password in the DSN AutoDL. ... Proc: webWhoAmI ... connection. ...
    (microsoft.public.exchange2000.applications)