I have tried grep -c but that doesnt work either, it keeps on dumping out.
The script is actually a
TCL script with embedded UNIX commands. The part its failing on is like so:
set td [exec grep -c "InvalidMessage" $logdir/$t | wc -l]
(I have assigned the variables logdir and t from before)
and i run the script and this occurs:
child process exited abnormally
while executing
"exec grep -c "InvalidMessage" $logdir/$t | wc -l"
It happens because there are no "InvalidMessage" strings in the file, but I know this and want the result i.e. 0 to be assigned to td