Skip to content

Suggestion: ./go-script -c 'script.Stdin()...' tool for running these #183

Open
@simonw

Description

@simonw

I built a little Bash script to let you do this: https://til.simonwillison.net/bash/go-script

cat file.txt | ./goscript.sh -c 'script.Stdin().Column(1).Freq().First(10).Stdout()'

It supports this too:

cat file.txt | ./goscript.sh top10.goscript

And this, saved as top10.goscript and made executable:

#!/tmp/goscript.sh
script.Stdin().Column(1).Freq().First(10).Stdout()

Then run like this:

cat file.txt | ./top10.goscript 

It's a fun little hack in Bash, but maybe something like this could be useful as an actual Go program distributed as part of this project.

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