From 4f12162ff54d92c9d8daf0a98d90720ca805e254 Mon Sep 17 00:00:00 2001 From: Darko Luketic Date: Tue, 2 Aug 2016 15:36:02 +0200 Subject: [PATCH] updated README.md --- README.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 615aeec..d57ef39 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ b2e -s="source path" -d="destination file" default values are s = ".\" + d = ".\bash.go" ## licence @@ -17,4 +18,72 @@ MIT ## Author -Darko Luketic \ No newline at end of file +Darko Luketic + +## Example Output + +```go +package bash + +import ( + "os" + "os/exec" +) + +func DiskusageCommand() error { + cmd := exec.Command("du", "-h") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if e := cmd.Start(); e != nil { + return e + } + if e := cmd.Wait(); e != nil { + return e + } + + cmd = exec.Command("mkdir", "-p", "/var/lib/go") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if e := cmd.Start(); e != nil { + return e + } + if e := cmd.Wait(); e != nil { + return e + } + + cmd = exec.Command("go", "get", "-u") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if e := cmd.Start(); e != nil { + return e + } + if e := cmd.Wait(); e != nil { + return e + } + +} + +func ListCommand() error { + cmd := exec.Command("ls", "-lah") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if e := cmd.Start(); e != nil { + return e + } + if e := cmd.Wait(); e != nil { + return e + } + + cmd = exec.Command("df", "-h") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if e := cmd.Start(); e != nil { + return e + } + if e := cmd.Wait(); e != nil { + return e + } + +} + +``` \ No newline at end of file