Skip to content

Ability to run a script from stdin #126

@wiktor-k

Description

@wiktor-k

Hi,

I just found rust-script and it's super-great! ❤️

I'm using it to generate a small Rust script and then run it like that:

sed 's/PKG/{{ pkg }}/g;s/KIND/{{ kind }}/g' > .script.rs <<< '{{ render-script }}'
chmod +x .script.rs
./.script.rs {{ output }}
rm --force .script.rs

And I thought it would be convenient if I could just pipe the script directly to rust-script without saving it to file, something like that:

sed 's/PKG/{{ pkg }}/g;s/KIND/{{ kind }}/g' | rust-script --some-kind-of-option <<< '{{ render-script }}'

I've seen that there's a --loop option but sadly this is for writing filters not entire scripts.

Would something like this be in-scope for this project?

Thanks! 👋

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions