On 2020-11-14 12:23, ToddAndMargo via perl6-users wrote:
Hi All,

How do I use qqx or other to run and release a
program in the background, like bash's "&"?

Many thanks,
-T



My revised keeper:

How to run and release a file:

Note: this command runs OUTSIDE the shell.  There are no
      environmental variables to be found such as $HOME

      the parameters are in quotes, including the name of
      the program to run, just like `run`

$ p6 'my $pA = Proc::Async.new( "/usr/bin/leafpad" ); my $promise = $pA.start; await $promise;'
$ p6 'my $pA = Proc::Async.new( "/usr/bin/leafpad" ); $pA.start;'
$ p6 'my $pA = Proc::Async.new( '/usr/bin/leafpad "/home/linuxutil/XferParts.pl6.tmp"' ); $pA.start;'


To get this to run with the shell, call "bash -c".
  Note: all the parameters to the command bash executing
        with "-c" go into an embedded quote stream.
        For example:

            '/usr/bin/leafpad "/home/linuxutil/XferParts.pl6.tmp"'

my $pA = Proc::Async.new( "bash", "-c", '/usr/bin/leafpad "/home/linuxutil/XferParts.pl6.tmp"' );
   say $pA;
   $pA.start;

Proc::Async.new(path => "bash", args => ["-c", "/usr/bin/leafpad \"/home/linuxutil/XferParts.pl6.tmp\""], command => ("bash", "-c", "/usr/bin/leafpad \"/home/linuxutil/XferParts.pl6.tmp\""), w => Any, enc => "utf8", translate-nl => Bool::True, win-verbatim-args => Bool::False, started => Bool::False)

Reply via email to