On 2020-11-13 18:26, Curt Tilmes wrote:
On Fri, Nov 13, 2020 at 9:03 PM ToddAndMargo via perl6-users
<perl6-us...@perl.org> wrote:
Fedora 33
I know I can get this information from a system
call to "ps", but is there a way to tell if a
program in running from Raku?
Running ps is probably as good as anything, but in linux you could
always just poke around under /proc,
e.g. Loop over /proc/*/cmdline and look for it.
Follow up:
$PsStr = qqx ( ps ax );
if $PsStr.contains( "gnucash" ) {
PrintGreen( "GnuCash is running\n\n" );
} else {
# qqx ( gnucash );
my $pA = Proc::Async.new( "/usr/bin/gnucash" );
$pA.start;
PrintGreen( "GnuCash started\n\n" );
}