script icon indicating copy to clipboard operation
script copied to clipboard

Making it easy to write shell-like scripts in Go

Results 65 script issues
Sort by recently updated
recently updated
newest added

I found the library is great and covers most of bash scripting, but you know most of the time when you do bash scripting, you do it on remote servers...

Add some equivalent to the Linux command: mktemp

`liumou@liumou-PC:~/LinuxData/git/golang/dmeo$ cat demos.go package main import ( "gitee.com/liumou_site/logger" "github.com/bitfield/script" ) func main() { // file := "/tts" pd := "1" c := "sudo -S rm -f /testing" res, err :=...

Writing #159 I thought that it could be good to have a way to use the stdout of a command executed with `Exec` as parameter of a following `Exec` call....

I wondered if all the [source functions](https://pkg.go.dev/github.com/bitfield/script#readme-sources) that receive a string as a parameter could receive a string format and a variadic string parameters as the fmt standard Go package...

Several people have noted that the behaviour of `Stdout` is a bit puzzling when there's an error in the pipe, especially for beginners: it just prints nothing! Unless the program...

I'm trying to execute a onepassword cli command and it doesn't work even though exit code return 0 ``` func main() { cmd := "op item create --format=json --vault= --category=\"API...

Example ``` $ cat t.txt column1 ./go.sum column2 ./go.mod ``` ```bash cat t.txt | awk '{print($2" "$1)}' # Swap 1, 2 columns # ./go.sum column1 # ./go.mod column2 cat t.txt...

[feat] ExecForEach: Get parameters by column index https://github.com/bitfield/script/issues/152

Is it possible to add parallel invocation of commands? Something like GNU Parallel: ``` ls | parallel md5sum ``` Of course, using `parallel` directly is a solution... but some simple...