I have a file named $dir and a string named $line, I know that this string is a complete line of that file but I don\'t know its line number and I
$dir
$line
Read the lines one by one, and write all but the matching line to another file. Then replace the original file.