|
Sorry, I probably didn't make my question clear.
I have a file (proc.txt) which has a list of lines I want to remove from a file (draft). I can not hard code the lines in my shell script since each line in the proc.txt are different.
I believe I need a loop to check each line in proc.txt and remove the line from (draft) and copy them to a file.
So the input/output I am hoping to get is
Draft(before remove)
Author:
Date:
1 /vobs/aw/database/a.proc/
2 /vobs/aw/database2/b.proc/
3 /vobs/aw/database4/a.proc/
4 /vobs/aw/database4/b.proc/
5 /vobs/aw/database2/d.proc/
...etc
proc.txt
/vobs/aw/database2/b.proc/
/vobs/aw/database4/b.proc/
...etc
I hope to write a script to achieve the following:
draft(after remove)
Author:
Date:
1 /vobs/aw/database/a.proc/
3 /vobs/aw/database4/a.proc/
5 /vobs/aw/database2/d.proc/
...etc
proc.txt(no change)
/vobs/aw/database2/b.proc/
/vobs/aw/database4/b.proc/
...etc
output.txt(new file)
2 /vobs/aw/database2/b.proc/
4 /vobs/aw/database4/b.proc/
I hope I have made my question more clear.
Is it possible to use shell script to achieve this?
Thanks in advance for your help
|