in reply to tail script

Is the file "/opt/btb_webservice/ver3/lease_list.txt" writable ?

Mixing shell and perl without error checking is error prone.

I'd recommend using the perl module File::Inplace to replace your "sed" call, using something like (untested):

use File::Inplace; my $editor = File::Inplace::->new( file => "/opt/btb_webservice/ver3/lease_list.txt"); while (my ($line) = $editor->next_line) { $line =~/$client_mac/ or next; $editor->replace_line(""); # Zap line } $editor->commit;

        Our business is run on trust. We trust you will pay in advance.