Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

question around 'exec'

5 views
Skip to first unread message

Tony

unread,
Feb 8, 2012, 8:42:14 AM2/8/12
to
Hi,

New to tcl.
My system is linux and when I run from a terminal "echo $?" it returns
0 or 1 depending on the last command result.
Under tclsh when I run "exec echo $?" it returns "$?" where I expected
to see 0 or 1 !

what am I doing wrong?
thank you for your help
T

Bruce

unread,
Feb 8, 2012, 10:43:43 AM2/8/12
to
$? is a shell variable. Tcl's exec does not use a shell.

if you are exec'ing a command and need to know the return value
you get that directly with exec (and catch) - see man page for exec

Bruce


0 new messages