script
script copied to clipboard
Making it easy to write shell-like scripts in Go
There's many pipeline packages "out there" but script seems to be one that gets it conceptually correct. Question: Should it be possible to attach a data structure to a pipeline...
After a [recent conversation about `script` on Lobste.rs](https://lobste.rs/s/zknwrk/scripting_with_go), I'm concerned about how `ExecForEach` handles arguments (especially filenames?) with tricky characters (e.g., spaces, single quotes, and double quotes). The current example...
Right now Columns takes an int, and uses strings.Fields to split the line. I'd like to propose we add a delimiter, so that you could parse csv, semicolon, or pipe...
I have a long running Exec() query: ``` script.Exec("/home/aaron/big-script.sh") ``` This command takes a long time, but is always successful. How can I check the progress of this Exec query?...
In this PR I tried to fix #110 Here I take into consideration whether any files are matched at all or not and then ListFiles() only produces an output if...
Perhaps similar in spirit to some aspects of #116, I think you could provide a set of simple, interactive inputs using TUI elements provided by [bubbletea](https://github.com/charmbracelet/bubbletea) and [bubbles](https://github.com/charmbracelet/bubbles). There are...
Every so often, I need to automate tasks that need to provide answers to interactive programs For instance, to simulate user's sessions or just because the program does not provide...
Hi It seems Basename introduces a line feed in the generated path, hope I'm not doing anything wrong: ``` package main import ( "fmt" "os" "path/filepath" "github.com/bitfield/script" ) func main()...
Love this project t - thanks for doing it. Is there a formal way of replacing many consecutive lines in a file ? There seems to only the ability to...
Calling `String` followed by `Exec` returns a string ending with a new line (i.e. `\n`). Example: ```go out, err := script.Exec("echo hello").String() if err != nil { log.Fatal(err) } fmt.Printf("%q\n",...