I have a problem with egrep command. When I execute my command in tcsh it is working perfect but when I execute it from tcl script or in tclsh, I got:
c
grep uses its exit status to indicate presence/absence of a match (man page) - if no matches the exit status is 1. Tcl's exec
treats any non-zero exit status as an exceptional situation. You need to catch
the exec call, check the return value from catch and if nonzero examine the $errorCode
variable. A thorough example here: http://wiki.tcl.tk/exec, click "Show Discussion" and scroll down to KBK's example.