diff options
| author | jet2tlf <jet2tlf@gmail.com> | 2024-05-30 02:04:04 +0000 |
|---|---|---|
| committer | jet2tlf <jet2tlf@gmail.com> | 2024-05-30 02:04:04 +0000 |
| commit | 962c7496ed455f534ffab7bf48306652fd2d14e7 (patch) | |
| tree | 4091282dc721601adcefa4fb83432a875b921eb0 /cmd/myshell | |
| parent | 705f9c214695df293fc68bac774e45815858dabc (diff) | |
| download | shell-go-962c7496ed455f534ffab7bf48306652fd2d14e7.tar.gz shell-go-962c7496ed455f534ffab7bf48306652fd2d14e7.zip | |
pass 2st stage
Diffstat (limited to 'cmd/myshell')
| -rw-r--r-- | cmd/myshell/main.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/myshell/main.go b/cmd/myshell/main.go index f5c858a..cebcdd0 100644 --- a/cmd/myshell/main.go +++ b/cmd/myshell/main.go @@ -4,11 +4,17 @@ import ( "bufio" "fmt" "os" + "strings" ) func main() { fmt.Fprint(os.Stdout, "$ ") // Wait for user input - bufio.NewReader(os.Stdin).ReadString('\n') + in, err := bufio.NewReader(os.Stdin).ReadString('\n') + if err != nil { + fmt.Fprintf(err.Error()) + } + + fml.Fprintf("%s: command not found\n", strings.TrimRight(in, "\n")) } |