Difference in exec argument passing at Tcl/Tk 8.4 
Author Message
 Difference in exec argument passing at Tcl/Tk 8.4

Can anyone explain this difference bvetween Tcl/Tk 8.4 and 8.3

8.3
% exec echo [list 1 2 "3 and 4"]
1 2 {3 and 4}

8.4
% exec echo [list 1 2 "3 and 4"]
1 2 \{3 and 4}

Note the extra back-slash at 8.4 which looks wrong to me.

I am running on Windows (98) with version ActiveTcl8.4.1.0-2-win32-ix86.exe

Thanks



Mon, 11 Jul 2005 04:01:46 GMT  
 Difference in exec argument passing at Tcl/Tk 8.4

Quote:

> Can anyone explain this difference bvetween Tcl/Tk 8.4 and 8.3

> 8.3
> % exec echo [list 1 2 "3 and 4"]
> 1 2 {3 and 4}

> 8.4
> % exec echo [list 1 2 "3 and 4"]
> 1 2 \{3 and 4}

This is a consequence of fixing Tcl Bug 554068, I think.

--
| Don Porter          Mathematical and Computational Sciences Division |

| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|



Mon, 11 Jul 2005 04:10:13 GMT  
 Difference in exec argument passing at Tcl/Tk 8.4

Quote:

>Can anyone explain this difference bvetween Tcl/Tk 8.4 and 8.3

>8.3
>% exec echo [list 1 2 "3 and 4"]
>1 2 {3 and 4}

>8.4
>% exec echo [list 1 2 "3 and 4"]
>1 2 \{3 and 4}

>Note the extra back-slash at 8.4 which looks wrong to me.

>I am running on Windows (98) with version ActiveTcl8.4.1.0-2-win32-ix86.exe

Are you sure that this is your complete code? If I say
        exec echo [list 1 2 "3 and 4"]
I get the error
        couldn't execute "echo": no such file or directory
(I know the 'echo' command but I don't think you can activate it this
way.)

This is on W98 and Tcl 8.4.1.
Helmut Giese



Mon, 11 Jul 2005 04:12:02 GMT  
 Difference in exec argument passing at Tcl/Tk 8.4

Quote:



> >Can anyone explain this difference between Tcl/Tk 8.4 and 8.3

> >8.3
> >% exec echo [list 1 2 "3 and 4"]
> >1 2 {3 and 4}

> >8.4
> >% exec echo [list 1 2 "3 and 4"]
> >1 2 \{3 and 4}

> >Note the extra back-slash at 8.4 which looks wrong to me.

> >I am running on Windows (98) with version ActiveTcl8.4.1.0-2-win32-ix86.exe
> Are you sure that this is your complete code? If I say
>    exec echo [list 1 2 "3 and 4"]
> I get the error
>    couldn't execute "echo": no such file or directory
> (I know the 'echo' command but I don't think you can activate it this
> way.)

> This is on W98 and Tcl 8.4.1.
> Helmut Giese

Yes, I think I can do this. I would suggest that either echo is not
installed on your machine or is not in your command path.

Thanks

Mick



Mon, 11 Jul 2005 14:37:00 GMT  
 Difference in exec argument passing at Tcl/Tk 8.4

Quote:


> > Can anyone explain this difference bvetween Tcl/Tk 8.4 and 8.3

> > 8.3
> > % exec echo [list 1 2 "3 and 4"]
> > 1 2 {3 and 4}

> > 8.4
> > % exec echo [list 1 2 "3 and 4"]
> > 1 2 \{3 and 4}

> This is a consequence of fixing Tcl Bug 554068, I think.

Don,

Thanks. I have read this bug report now and you could well be right. I
think 8.4 has wrong behaviour in this respect. Do people agree?

BTW, I am trying to send a code fragment as an argument from one wish
application to a new one. It used to work fine, but now fails (to eval
in the second application). I am sure I can get round it.

SoftMick



Mon, 11 Jul 2005 14:41:43 GMT  
 Difference in exec argument passing at Tcl/Tk 8.4

| > This is on W98 and Tcl 8.4.1.
| > Helmut Giese
|
| Yes, I think I can do this. I would suggest that either echo is not
| installed on your machine or is not in your command path.

W98 most probably has `echo' only as a built-in in command.com,
whereas your OS has it as a standalone executable in /bin or somesuch.

R'



Mon, 11 Jul 2005 16:58:22 GMT  
 Difference in exec argument passing at Tcl/Tk 8.4

Quote:



> > > Can anyone explain this difference bvetween Tcl/Tk 8.4 and 8.3

> > > 8.3
> > > % exec echo [list 1 2 "3 and 4"]
> > > 1 2 {3 and 4}

> > > 8.4
> > > % exec echo [list 1 2 "3 and 4"]
> > > 1 2 \{3 and 4}

> > This is a consequence of fixing Tcl Bug 554068, I think.

> Don,

> Thanks. I have read this bug report now and you could well be right. I
> think 8.4 has wrong behaviour in this respect. Do people agree?

I agree. I don't see where tcl needs to escape some arguments I'm
sending to an unknown process. Below I created a file on win2k that
starts with an open brace - no problem. But I can't ls the file
directly because exec escapes the brace.
241 C:/Roy> cat > '{you'
hi mom
^Z
242 C:/Roy> nd
-- -
01/23/2003  06:54a                   8 {you

243 C:/Roy> tclsh84
% exec ls.exe \{you
ls: File or directory "\{you" is not found
# but 8.3 works as I tell it to work!
% exit
244 C:/Roy> tclsh83
% exec ls.exe \{you
{you

Seems like this fix was more motivated by making the
test result run clean than by the needs of exec. I don't
see anything on the man page suggesting it ought to
do this escape. Why dig the exec pit deeper?

Roy



Mon, 11 Jul 2005 23:02:00 GMT  
 Difference in exec argument passing at Tcl/Tk 8.4

Quote:



> > > 8.4
> > > % exec echo [list 1 2 "3 and 4"]
> > > 1 2 \{3 and 4}

> > This is a consequence of fixing Tcl Bug 554068, I think.
> Thanks. I have read this bug report now and you could well be right. I
> think 8.4 has wrong behaviour in this respect. Do people agree?

Well, Tcl 8.3 fails with this:

exec cat $filename

if filename contains characters like '{', and Tcl 8.4 works, so I
think 8.3 has the wrong behaviour in this respect.

I think we need something which fixes both problems...

Vince.



Mon, 11 Jul 2005 23:51:26 GMT  
 Difference in exec argument passing at Tcl/Tk 8.4
Quote:




> > > > 8.4
> > > > % exec echo [list 1 2 "3 and 4"]
> > > > 1 2 \{3 and 4}

> > > This is a consequence of fixing Tcl Bug 554068, I think.
> > Thanks. I have read this bug report now and you could well be right. I
> > think 8.4 has wrong behaviour in this respect. Do people agree?

> Well, Tcl 8.3 fails with this:

> exec cat $filename

> if filename contains characters like '{', and Tcl 8.4 works, so I
> think 8.3 has the wrong behaviour in this respect.

> I think we need something which fixes both problems...

> Vince.

Huh? My experience is the opposite. Can you show the
details of the failure you're describing?

256 C:/Roy> cat > me{you
hi to me you
^Z
257 C:/Roy> nd
-- -
01/23/2003  10:47a                  14 me{you

258 C:/Roy> tclsh84
% puts $tcl_patchLevel
8.4.0
% set x me{you
me{you
% exec cat $x
cat: me\{you: The system cannot find the path specified.
% exit
259 C:/Roy> tclsh83
% set x me{you
me{you
% exec cat $x
hi to me you



Tue, 12 Jul 2005 02:50:24 GMT  
 Difference in exec argument passing at Tcl/Tk 8.4

Quote:


> > > > 8.4
> > > > % exec echo [list 1 2 "3 and 4"]
> > > > 1 2 \{3 and 4}
> > > > I think 8.4 has wrong behaviour in this respect. Do people agree?

> Well, Tcl 8.3 fails with this:

> exec cat $filename

> if filename contains characters like '{', and Tcl 8.4 works, so I
> think 8.3 has the wrong behaviour in this respect.

> I think we need something which fixes both problems...

> Vince.

It seems we all agree that this is not how exec should work. That's
good. Thanks for everyones help. I have reported the bug and hope that
someone is able to fix it.


Tue, 12 Jul 2005 06:48:49 GMT  
 Difference in exec argument passing at Tcl/Tk 8.4

Quote:


...
>> I
>> think 8.4 has wrong behaviour in this respect. Do people agree?
>I agree. I don't see where tcl needs to escape some arguments I'm
>sending to an unknown process.

I wish the fix was easy to encapsulate.  It's not as simple as just making
tcl's output to [exec] be equal to it's input launching another tclsh
shell.

Yes, it must do that and the trick is to also follow the rules for arg
quoting to CreateProcess() that any other Win32 process would expect.  In
the C-runtime, parse_cmdline() (src\crt\stdargv.c) must be inverse to
BuildCommandLine() (win\tclWinPipe.c), but tclsh doesn't use
parse_cmdline.  It uses a custom one called setargv contained in
win\tclAppInit.c

Some analysis needs to be done to get this repaired.
--

[species: human; planet: earth,milkyway,alpha sector]



Tue, 12 Jul 2005 14:56:14 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. OpenGL Bindings for Tcl/Tk 8.4

2. ::tk::dialog::file:: throws Error in Tcl 8.4!

3. tkBuilder Fix (temporary) for Tcl/Tk 8.4

4. TCL_LIBRARY environment variables settings in Tcl/Tk 8.4 Win2k3

5. ISO: Help regarding Tcl/Tk 8.4 Japanese Input Methods

6. Tix and Tcl/Tk 8.4

7. tkogl - tcl/tk 8.4 precompiled binary DLLs

8. Announce: TkInfo 2.6, works with Tcl/Tk 8.4

9. ANNOUNCE: TkMan 2.2 final for Tcl/Tk 8.4

10. Tcl/Tk 8.4.* Windows helpfile

11. ANNOUCE: TkMan 2.2b1 for Tcl/Tk 8.4

12. Tcl/Tk 8.4 listing on osdir.com

 

 
Powered by phpBB® Forum Software