question

dclaar avatar image
dclaar Suspended asked dclaar Suspended posted

In quoting hell...again. tclsh commands

 

% set mysql "C:/Program Files/MySQL/MySQL Server 5.1/bin/mysql.exe"
% % $mysql --no-defaults -h host -u user db --e "status"
--------------
C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.exe  Ver 14.14 Distrib 5.1.31, for Win32 (ia32)

Connection id:          96039
Current database:       db
...

But, over in iTest land: Open tclsh. Issue the commands as tclsh commands:

 

set mysql "C:/Program Files/MySQL/MySQL Server 5.1/bin/mysql.exe"

No substitution.

\$mysql --no-defaults -h [param dbhost] -u [param dbuser] [param db] --e "status"
Substitution.
invalid command name "C:/Program Files/MySQL/MySQL Server 5.1/bin/mysql.exe"

Can't find it. I've tried various combinations of making the mysql variable be in iTest, quoting it, squiggly-ing it, all to no avail.

 

Looking at the console, it tells me that my "Final description" matches what I did in the "real" tclsh. So why doesn't it work???

iTest
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
dclaar avatar image
dclaar Suspended answered dclaar Suspended posted
exec \$mysql ... works.
1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

PaulD avatar image PaulD commented ·
Some Tcl interpreters assume that if they don't know the command, they will try to get the shell to execute it.  But the official way to ask for Tcl to run a process is "exec".  So hopefully you're off to the races.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.