Hi All,
I am facing 'No Match' problem with foreach loop in C shell script.
Initially I tried following grep command showing results properly as shown at the end of the Thread. But foreach command is throwing the error 'No match'.
grep -n Inserted audit_file
foreach insertstr (`grep -n Inserted audit_file`)
echo "$insertstr"
Temporarily I have copied output of the grep command into a temp file. Now the foreach command has moved a little bit but thrwoing follwoing error
50:00000050 2009/04/: No such file or directory
foreach Insertstr ("`cat temp.txt`")
00000050 2009/04/24 02:35:16.520 OPGS 529 INFO BATR Inserted [35] complete messages
00000079 2009/04/24 03:35:19.128 OPGS 529 INFO BATR Inserted [64] complete messages
00000022 2009/04/24 04:35:25.541 OPGS 529 INFO BATR Inserted [7] complete messages
00000017 2009/04/24 16:00:06.058 OPGS 529 INFO BATR Inserted [2] complete messages
00003480 2009/04/24 16:20:47.631 OPGS 529 INFO BATR Inserted [3465] complete messages
Thanks
-Durga