> 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?

Usually sed gives such problem when you have variable in it. Are 
you sure $a does not have any char which will break the 
expression ? (like '/ char)

BTW, looks like you are doing a while loop did you try echoing all 
the lines ?

Rgds,
Siva.
_______________________________________________
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