I am trying to use find command with if..else statement. What I actually want to do is, search for a specific string in multiple log files. If I find that string I want to append the name of that file with "Passed" else "Failed" into another text file.
I have tried the following but it doesn't work:
if (find /n /i "0 error" "filename.log") (
echo "Passed" > log.txt
) else (
echo "Failed" > log.txt
)