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
I had the same error when running the following command:
exec top -b -n 1 -c | egrep lnx64.o/vsimk | wc -l
TCL wasn't happy about forward slash "/" in the grep expression. It got fixed by using "-ignorestderr" switch:
exec -ignorestderr -- top -b -n 1 -c | egrep lnx64.o/vsimk | wc -l.