home.social

#shell_function — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #shell_function, aggregated by home.social.

  1. For anyone using the #fish_shell, the following #shell_function definition will let you switch to the latest CRuby #chruby knows about. It could be simplified (e.g. setting a function-local variable is mostly for debugging) or use builtins instead of pipes in shells where that matters, but I still find it useful for myself. Maybe you will, too.

    ```fish
    function chruby-latest
    set latest (
    chruby | tr -d '*' |
    pcregrep -o '\bruby-[\d.]+' | tail -1)
    chruby $latest
    end
    ```