i use 'sed' with this syntax
" sed "/$lineerr/d" $fileerr > $fileerr"_Bak" && mv $fileerr"_Bak" $fileerr"
it's work to remove the line that have the word in $lineerr
but it also remove my last line in file too. - -"
my input File
$ cat fileerr.txt
xx|1111111111
xx|2222222222
xx|3333333333
xx|4444444444
nn|4$
output File ** $lineerr = "2222222222"
$ cat fileerr.txt
xx|1111111111
xx|3333333333
xx|4444444444
$
Thank you very much.
*** this file format must be in the input file format ( not have a new line int the end of file )