Hi Liz!
> sub prefix:<`>(*@a) { (run @a, :out).out.lines }
Thanks for this example, I now can write things like
.say for grep / '.txt' $ /, `
for ` { .say if / '.txt' $ / }
which made me remember I wrote something similar (but not working) for
the FOSDEM talk:
sub
> On 4 Aug 2022, at 14:38, Marc Chantreux wrote:
> It would be nice to define a backtrick operator (like in rc) so we
> could write
>
> my @installed-files =
> grep *.IO.f,
> map *.trim,
> `< dpkg-query -f ${db-fsys:Files} -W gnuplot* >;
>
>
hello Liz and thanks for helping,
> I believe you could use App::Rak for that:
> $ zef install App::Rak
I'll test rak at some point but in this case, I can just write
dpkg-query -f \${db-fsys:Files} -W gnuplot\* |
raku -pe '.=trim; .say if .trim.IO.f'
I asked the question
Hi Brian and thanks for your reply.
> There is the 'x' adverb for Q -- I think qx is equivalent to Q:x
exactly. that's why Q:x doesn't help as it still run sh -c to execute
the command.
regards,
--
Marc Chantreux
Pôle de Calcul et Services Avancés à la Recherche (CESAR)
On Thursday, August 4, Marc Chantreux wrote:
> I read the Proc documentation and tried to see if there was another
> command or an adverb to the qx construction (something like :r for run).
There is the 'x' adverb for Q -- I think qx is equivalent to Q:x
https://docs.raku.org/syntax/Q
Brian
> On 4 Aug 2022, at 10:35, Marc Chantreux wrote:
>
> hello people,
>
> I found myself choosing between
>
> raku -e '
> (run :out, <
> dpkg-query -f ${db-fsys:Files} -W gnuplot*
> > ).out>>.lines>>.trim>>.grep(*.IO.f)>>.say'
>
> and
>
> raku -e '
> qx<
>