For example, generally I need to check for 5 strings. (Note : the strings are in file format .txt)
- file1.txt
- file2.txt
- file3.txt
- file4.txt
- file5.txt
but there are 3 strings in abc.txt
- file1.txt
- file2.txt
- file3.txt
I wanted to check for specific strings in that abc.txt file and write the missing strings to xyz.txt file using a shell script.
example :-
file1.txt, file2.txt, file3.txt already exists in abc.txt --> so, it should leave or print any message like mentioned string exists
file4.txt, file5.txt does not exists in abc.txt --> so, when I check for these 2 strings, it should print a message specified file does not exits and it should write that missing string to xyz.txt file
example:- Input:- file/script/abc.txt abc.txt contains the following file1.txt file2.txt file3.txt
output:- file/script/xyz.txt xyz.txt should contain the following file4.txt file5.txt
Please note:- file4 and file5 are missing files in abc.txt
I have used the below code:-
Could anyone please help me as soon as possible.
Thanks in advance