Ruby for "shell scripting" (2024)

15 points by wezm


ab5tract

I’ve been preparing a post about “shell scripting” with Raku that I’m excited to share. This post is helpful for that effort in giving me a different example of how such a post could be structured.

FWIW, I think that Raku shares a lot of the positive points for Ruby laid out in this article. Some points are arguably even nicer in Raku. I think $! is the only remaining “obscure” variable left. Arguments are stored in @*ARGS, the environment landscape is accessible through %*ENV, stdin is $*IN, etc. (the * twigil indicates a dynamic variable, meaning that the variable is resolved through the caller scope, rather than the outer, in case you were wondering).)

Another advantage is that file processing pipelines fit very neatly into the supply style “reactive” concurrency that is available in Raku.

I’ll always have a soft spot for Ruby and would rather encounter it over Bash or Python any day.