Skip to content

Instantly share code, notes, and snippets.

@tobstarr
Last active December 22, 2015 19:39
Show Gist options
  • Save tobstarr/6521231 to your computer and use it in GitHub Desktop.
Save tobstarr/6521231 to your computer and use it in GitHub Desktop.
Golang Heisenberg
Committed_AS: 3607224 kB
Committed_AS: 3872632 kB
Committed_AS: 3607156 kB
package main
import "fmt"
import "os/exec"
import "strings"
func main() {
res, _ := exec.Command("bash", "-c", "grep Committed_AS /proc/meminfo").CombinedOutput()
fmt.Println(strings.TrimSpace(string(res)))
}
#!/bin/bash
set -e
go build -o ./test ./test.go
grep Committed_AS /proc/meminfo
./test
grep Committed_AS /proc/meminfo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment