Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2013-11-12
12:36 • Closed ticket [1546827fff]: exec fails on explicit quotes plus 6 other chang... artifact: 0ee75ff4e4 user: dkf
2012-05-30
17:35 • Pending ticket [1546827fff]. artifact: 3240385724 user: dkf
2006-09-22
16:38 • Ticket [1546827fff]: 4 changes artifact: f9ca5685a6 user: mpc_janssen
2006-08-28
14:51 • Ticket [1546827fff]: 4 changes artifact: 4f6d5ca307 user: suchenwi
01:09 • Ticket [1546827fff]: 5 changes artifact: 2f0623ddb0 user: dkf
2006-08-27
10:46 • Ticket [1546827fff]: 6 changes artifact: 49929743c1 user: dgp
2006-08-25
18:24 • New ticket [1546827fff]. artifact: 7350ed5166 user: suchenwi

exec fails on explicit quotes

Closed / Wont Fix1546827fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 13 years ago
Descriptionplain2006-08-25 18:24:18
Win XP, 8.4.12

% exec echo {"a b"}
"a b\
% exec echo {"a,b"}
,b"
(the last also beeped, probably taking \a too 
literally)
Background: we need to call
cacls \some\file /x /y "Authorized Users":f

and I could no way to do this with exec - the last 
word seems always to go wrong.
dgpplain2006-08-27 10:46:39
Logged In: YES 
user_id=80530


This only happens on Windows,
where apparently there's no
good interface to pass 
argument words separately.
dkfplain2006-08-28 01:09:30
Logged In: YES 
user_id=79902

suggested workaround: write a temporary batch file that
contains the awkward command invokation, and run that.
suchenwiplain2006-08-28 14:51:39
Logged In: YES 
user_id=1478027

Even simpler workaround (found on the Wiki):

exec cmd << "echo \"a,b\"\n"
mpc_janssenplain2006-09-22 16:38:38
Logged In: YES 
user_id=1463011

If it is possible to use additional extensions, TWAPI can be
used to achieve the desired effect.

package require twapi
::twapi::create_process {} -cmdline {cacls c:\test.txt /P
"Authorized Users":f} -showwindow hidden
dkfplain2012-05-30 17:35:56
Since this is tangled up in the mess of Windows' command line parsing (bottom line: each program can do its own whimsical thing, and too many do exactly that) I see no prospect of ever making this much better than what we have now. It's a horrible compromise.
dkf Closed ticket [1546827fff]. [History diff]2013-11-12 12:36:32
Log in (anonymous is fine) to add a comment.