Hello all,

I have two files, A and B. File A has a number of lines that has to be
searched in file B and if it occurs in any line, the whole line has to be
removed from file B.

I am trying to write a bash script to accomplish this task. My script is as
below:

1: #!/bin/bash
2: cat file_a | while read a;
3: do
4:     sed -i \"/$a/ d\" file_b
5: done

For some reasons, the sed command gives error. *sed: -e expression #1, char
1: unknown command: `"'*

When I echoed the above line 4 in the script, it is displayed as *sed -i
"/aaa/ d" file_b*, which is correct. I also confirmed it by manually
executing the command echoed by the script. It works. Could anybody let me
know what is going wrong in my script?

Any help would be greatly appreciated.

Thanks,
Alexander
_______________________________________________
To unsubscribe, email [EMAIL PROTECTED] with 
"unsubscribe <password> <address>"
in the subject or body of the message.  
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to