From f248262eee4c7ddd9b77f9ddfa41da60c1b904c5 Mon Sep 17 00:00:00 2001 From: sgf Date: Wed, 27 Sep 2023 15:13:28 +0300 Subject: [PATCH] Save. --- ...cratch-Liz_Rice-GOTO_2018-8fi7uSYlOdc.webm | 1 + containers_from_scratch/main.go | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 120000 containers_from_scratch/Containers_From_Scratch-Liz_Rice-GOTO_2018-8fi7uSYlOdc.webm create mode 100644 containers_from_scratch/main.go diff --git a/containers_from_scratch/Containers_From_Scratch-Liz_Rice-GOTO_2018-8fi7uSYlOdc.webm b/containers_from_scratch/Containers_From_Scratch-Liz_Rice-GOTO_2018-8fi7uSYlOdc.webm new file mode 120000 index 0000000..12b9cf8 --- /dev/null +++ b/containers_from_scratch/Containers_From_Scratch-Liz_Rice-GOTO_2018-8fi7uSYlOdc.webm @@ -0,0 +1 @@ +../.git/annex/objects/wP/0p/SHA256E-s168951547--9415a4e2a39f00dc536d784bed2fea99989f7a0e2fabf253a1ac72a6ad574688.webm/SHA256E-s168951547--9415a4e2a39f00dc536d784bed2fea99989f7a0e2fabf253a1ac72a6ad574688.webm \ No newline at end of file diff --git a/containers_from_scratch/main.go b/containers_from_scratch/main.go new file mode 100644 index 0000000..d715f90 --- /dev/null +++ b/containers_from_scratch/main.go @@ -0,0 +1,32 @@ + +package main + +import ( + "fmt" + "os" + "os/exec" +) + +func main() { + switch os.Args[1] { + case "run": + run() + default: + panic("bad command") + } +} + +func run() { + fmt.Printf("Running %v\n", os.Args[2:]) + + cmd := exec.Command(os.Args[2], os.Args[3:]...) + //cmd := exec.Command("sleep", "5") + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + + fmt.Printf("SHLVL=%v\n", os.Getenv("SHLVL")) + err := cmd.Run() + fmt.Println(err) +} + -- 2.20.1