#!/usr/bin/perl $base = getppid; fork and exit; #detach myself from parent (so I'm not visible) $script = <<'script'; $c="\e[H\e[J"."IP-up scripts running...\n\n"; while (kill 0,$base) { print $c.`/usr/bin/pstree $base`; sleep 1; } print "\e[H\e[J"; script $script =~ s/\s+/ /g; #get rid of newlines $script =~ s/\$base/$base/g; #substitute $base # using hard-coded VT10, because otherwise fetchmail and this tend to grab the # same VT (presumably a bug in /bin/open) system "/bin/open -s -w -c 10 -- /usr/bin/perl -e '$script'"; sleep 3; #will this help deallocvt? system "/usr/bin/deallocvt"; #clear the terminal