#3493 exec fails on explicit quotes

obsolete: 8.4.12
pending-wont-fix
5
2012-05-30
2006-08-25
suchenwi
No

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.

Discussion

  • Don Porter
    Don Porter
    2006-08-27

    • labels: 105657 --> 27. Channel Types
    • assigned_to: dkf --> andreas_kupries
     
  • Don Porter
    Don Porter
    2006-08-27

    Logged In: YES
    user_id=80530

    This only happens on Windows,
    where apparently there's no
    good interface to pass
    argument words separately.

     
  • Logged In: YES
    user_id=79902

    suggested workaround: write a temporary batch file that
    contains the awkward command invokation, and run that.

     
    • milestone: --> obsolete: 8.4.12
     
  • suchenwi
    suchenwi
    2006-08-28

    Logged In: YES
    user_id=1478027

    Even simpler workaround (found on the Wiki):

    exec cmd << "echo \"a,b\"\n"

     
  • Mark Janssen
    Mark Janssen
    2006-09-22

    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

     
  • 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.

     
    • status: open --> pending-wont-fix