Skip to content
Tcl Source Code Artifact [9168b08841]
Login

Artifact [9168b08841]

Artifact 9168b088413424c264ba98bec63ebc85ab4c3e3598a087b373c187c785cf1748:

Ticket change [9168b08841] - Ticket [efd15d181ae9be3b|efd15d181a] <i>problem with % in [exec] on windows</i> status still Pending with 3 other changes by bll on 2020-07-28 01:52:51.
D 2020-07-28T01:52:51.166
J icomment Remember\sthat\sTcl\swill\sprocess\sthe\sdouble\squotes\sand\sin\sthis\sinstance\syou\r\nwant\sto\spass\sthem\sto\sthe\sWMIC\scommand.\r\n\r\nFor\sexample,\sI\shave\san\sexec\sin\smy\sprogram:\r\n\r\n\s\sset\scmd\s"\\"$::sysvars::v(prog.tasklist)\\"\s/fi\s\\"pid\seq\s$ppid\\"\s/nh\s2>nul"\r\n\s\sexec\s-ignorestderr\s--\s{*}$cmd\s2>@1\r\n\r\nas\sthe\squoted\sstring:\s"pid\seq\s<some-pid>"\smust\sbe\spassed\sto\swindows\swith\r\nthe\sdouble\squotes\sincluded.\r\n\r\nExamples\s(these\sall\swork):\r\n\r\n%\sclose\s[open\s"my\sfile"\sw]\r\n%\sexec\swrite\s"\\"my\sfile\\""\r\n%\sclose\s[open\sabc%def\sw]\r\n%\sexec\swrite\sabc%def\r\n%\sclose\s[open\s%abcdef%\sw]\r\n%\sexec\swrite\s%abcdef%\r\n%\r\n\r\nSo\stry\syour\scommand\swith\sthe\sdouble\squote\smarks\sescaped.\s\sThis\smay\stake\r\na\slittle\swork\sto\sfigure\sout.\s\sThat's\swhy\sI\slike\sto\sset\sthe\scommand\sline\r\nto\sexecute\sfirst,\sthen\sexec\sit\swith\sexec\s{*}$cmd.\s\sI\scan\sputs\s$cmd\sand\r\nsee\sexactly\swhat\swill\sbe\spassed\sto\sexec\s(since\sit\sis\sa\slist,\syou\shave\sto\r\nremember\sthat\smany\swords\swill\sbe\sbrace\squoted).
J login bll
J mimetype text/plain
K efd15d181ae9be3b538eb23534d37d8f1d96cd57
U bll
Z 9990b92d316b911db0f45f9a189fd022