Get system command output: Difference between revisions
m
Fix Perl 6 -> Raku links
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
Thundergnat (talk | contribs) m (Fix Perl 6 -> Raku links) |
||
Line 959:
=={{header|Raku}}==
(formerly Perl 6)
If you don't want to execute it in shell (and you probably don't), then use this:
<lang perl6>say run($command, $arg1, $arg2, :out).out.slurp-rest;</lang>
Line 968 ⟶ 969:
my $p2 = run 'cat', '-n', :in($p1.out), :out;
say $p2.out.slurp-rest;</lang>
See [http://doc.
If you really want to run something in shell and you understand potential security problems, then you can use <code>qx//</code> (interpolates environment variables) or <code>qqx//</code> (interpolates normally). See [http://doc.
<lang perl6>say qx[dir]</lang>
|