main.go 400B

1234567891011121314151617181920
  1. package main
  2. import (
  3. "bufio"
  4. "fmt"
  5. "os"
  6. )
  7. // Ensures gofmt doesn't remove the "fmt" import in stage 1 (feel free to remove this!)
  8. var _ = fmt.Print
  9. func main() {
  10. fmt.Print("$ ")
  11. command, err := bufio.NewReader(os.Stdin).ReadString('\n')
  12. if err != nil {
  13. fmt.Fprintln(os.Stderr, "Error reading input: ", err)
  14. os.Exit(1)
  15. }
  16. fmt.Println(command[:len(command)-1] + ": command not found")
  17. }