1 개요[ | ]
- Generate Shell Commands in Go
Go
CPU
-1.0s
MEM
-0M
-1.0s
Copy
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 /'"}))
}
echo hello foo.go bar.go '| rm -rf /' echo hello foo.go bar.go '; rm -rf /' echo hello foo.go bar.go ''\''| rm -rf /' echo hello foo.go bar.go ''\''; rm -rf /' echo hello foo.go bar.go ''\''| rm -rf /'\''' echo hello foo.go bar.go ''\''; rm -rf /'\'''
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.