I have string value as /tmp/Sne/test1.list and I have a file called all_tests.txt
This all_tests.txt contains lines below:
/tmp/Sne/test1.list
/tmp/Sne/test2.list
/tmp/Sne/test3.list
/tmp/Sne/test4.list
How to use grep to search if string value /tmp/Sne/test1.list is present in the all_tests.txt.
If present then I need to echo a message that file is present.
I tried using:
if [ grep -Fxq "$p" $Input_file ]; then echo "This file list is already checked"
where $p is /tmp/Sne/test1.list and $Input_file is all_tests.txt
This is not working.
Kindly request for help.