Version 6 of auto_execok

Updated 2002-12-18 16:35:59

auto_execok is one of several commands documented at http://www.tcl.tk/man/tcl8.4/TclCmd/library.htm


Canonical example usage:

    eval exec [auto_execok dir] *.$suffix

[Explain why this is better than $::env(COMSPEC), cmd.exe, ...]


To demonstrate why [eval] is required:

 % auto_execok start
 C:/WINNT/system32/CMD.EXE /c start
 % exec [auto_execok start] http://wiki.tcl.tk
 couldn't execute "C:\WINNT\system32\CMD.EXE \c start": invalid argument
 % eval exec [auto_execok start] http://wiki.tcl.tk
 % # success









See also exec, Invoking browsers,


Tcl syntax help - Arts and crafts of Tcl-Tk programming - Category Command