Generate Shell Commands in Go

1 개요[ | ]

Generate Shell Commands in Go
package main

import (
	"fmt"

	"github.com/keegancsmith/shell"
)

func main() {
	fmt.Println(shell.Sprintf("echo hello %S", []string{"foo.go", "bar.go", "| rm -rf /"}))
	fmt.Println(shell.Sprintf("echo hello %S", []string{"foo.go", "bar.go", "; rm -rf /"}))
	fmt.Println(shell.Sprintf("echo hello %S", []string{"foo.go", "bar.go", "'| rm -rf /"}))
	fmt.Println(shell.Sprintf("echo hello %S", []string{"foo.go", "bar.go", "'; rm -rf /"}))
	fmt.Println(shell.Sprintf("echo hello %S", []string{"foo.go", "bar.go", "'| rm -rf /'"}))
	fmt.Println(shell.Sprintf("echo hello %S", []string{"foo.go", "bar.go", "'; rm -rf /'"}))
}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}