tcl question: Exec

Joel Hammer joel
Mon May 17 11:57:30 PDT 2004


I want to test if a file exists using tcl by calling linux (bash) functions.

These commands give the following:

======================
set d [ exec echo OK]
This sets d to OK
======================

=====================================
set d 0
set d [ exec \[ -e /home/jlh/junk \] ]
The second command resets d to null.
======================================

================================================
set d [ exec \[ -e /home/jlh/junk \] && echo OK ]
This command fails with a missing bracket error.
=================================================

I would like to know why the last command fails.

Any insight appreciated,

Joel



More information about the Linux-users mailing list