Made a little test command to confirm nohup works. Nohup doesn't keep running on windows but that's expected.
parent
ffe26a9bf2
commit
e687198a3d
@ -0,0 +1,2 @@ |
||||
sleeper |
||||
sleeper.exe |
||||
@ -0,0 +1,4 @@ |
||||
|
||||
|
||||
build: |
||||
go build .
|
||||
@ -0,0 +1,3 @@ |
||||
module lcthw.dev/go/go-coreutils/sleeper |
||||
|
||||
go 1.25.3 |
||||
@ -0,0 +1,28 @@ |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
"time" |
||||
"flag" |
||||
"log" |
||||
) |
||||
|
||||
func main() { |
||||
wait_for := "1s" |
||||
message := "test" |
||||
|
||||
flag.StringVar(&wait_for, "d", "1s", "go time duration to parse") |
||||
flag.Parse() |
||||
|
||||
if flag.NArg() > 0 { |
||||
message = flag.Args()[0] |
||||
} |
||||
|
||||
for { |
||||
to_wait, err := time.ParseDuration(wait_for) |
||||
if err != nil { log.Fatal(err) } |
||||
|
||||
time.Sleep(to_wait) |
||||
fmt.Println(message) |
||||
} |
||||
} |
||||
Loading…
Reference in new issue