T
T
taaadm2015-03-02 09:10:15
Perl
taaadm, 2015-03-02 09:10:15

How to remove the system notification "Completed" after working out the script?

Here is the script:

#!/usr/bin/perl

my $timer1 = 11;
my $timer2 = 2;

my $parent = $$;
my $child = fork();

print "parent: ".$parent;
print "\nchild: ".$child;

if ( $$ == $parent ) {
        sleep($timer1);
        my $killchild = kill("TERM", $child);
        print "\nParent kill child\n";
}else{
        sleep($timer2);
        my $killparent = kill("TERM", $parent);
        print "\nChild kill power\n";
}

Here is the output with the parameters timer1 > timer2:

[[email protected] user]# ./test.pl
parent: 3580
parent: 3580
child: 3581
Parent kill child

Here is the output with the parameters timer1 < timer2:

[[email protected] user]# ./test.pl
parent: 3587
parent: 3587
child: 0
Child kill power
Completed

How to remove "Completed" system notification from output when timer1 < timer2?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question