Using Raku (formerly known as Perl_6)
A. You can design/run your own class Proc objects, which are representations of external command calls. Save below as a script and run:
my $proc = run 'echo', 'Hallo world', :out; my $captured-output = $proc.out.slurp: :close; say "Output was $captured-output.raku()";# OUTPUT: «Output was "Hallo world\n"»
B. Maybe you don't want to get your shell involved, so instead you can write your own Raku one-liners and point them at files in a particular dir() directory. Below returns .jpeg files and their creation dates, one line per .jpeg file:
~$ raku -e 'for dir( test => /:i '.' jpe?g $/ ) -> $file { say join "\t", $file, $file.IO.created.DateTime; }
https://docs.raku.org/type/Proc
https://docs.raku.org/routine/dir
C. Raku has the Ake module/script, which is useful for designing/running tasks:
~/Ake_Morning$ cat Akefile task 'buy-food', { say 'Bought a salad.' } task 'shower', { say 'Showered.' } task 'morning' => <shower buy-food>; task 'dinner' => <buy-food>, { say 'Yummy!' }
Then run the ake binary on the Akefile:
~/Ake_Morning$ ake Task “default” does not exist Did you mean one of these? buy-food dinner help morning shower ~/Ake_Morning$ ake morning Showered. Bought a salad.
https://github.com/Raku/ake
D. Raku also has the Sparrow6 (DSL) and Tomtit (task-runner) Ecosystem, which appears to be yaml-based. Sparrow can run tasks for you in 6 different languages: 1. Raku, 2. Perl, 3. Bash, 4. Python, 5. Ruby, and 6. Powershell.
https://github.com/melezhik/Tomtit
https://github.com/melezhik/Sparrow6/blob/master/documentation/dsl.md
https://raku.org