.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main

import (
"bytes"
"fmt"
"log"
"os/exec"
)

func shell_exec(s string) {

cmd := exec.Command("/bin/bash", "-c", s)
var out bytes.Buffer

cmd.Stdout = &out
err := cmd.Run()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s", out.String())
}
func main() {

shell_exec("cd /Users/zengguang/Downloads/pi&&rm -rf ./ceshi.sh")
}