develooper Front page | perl.perl6.users | Postings from August 2022

something between run and qx() ?

Thread Next
From:
Marc Chantreux
Date:
August 4, 2022 08:36
Subject:
something between run and qx() ?
Message ID:
YuuE3oc9LAP0qAYc@prometheus.u-strasbg.fr
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<
		dpkg-query -f \${db-fsys:Files} -W gnuplot\*
	>.lines.trim>>.grep(*.IO.f)>>.say'

I really love the qx syntax but

* it runs an extra useless sh processus
* I need to quote the shell symbols

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).

What I really would like to write is:

raku -e ' qx:r< dpkg-query -f ${db-fsys:Files} -W gnuplot* >.lines>>.grep(*.IO.f)>>.say '

Any suggestion is welcome.

Regards,

-- 
Marc Chantreux
Pôle de Calcul et Services Avancés à la Recherche (CESAR)
http://annuaire.unistra.fr/p/20200

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About