Skip to content
/ go-shell Public

Go-Shell is a simple shell implemented in Go. It supports basic commands, navigation with `cd`, and exiting with `exit`.

License

Notifications You must be signed in to change notification settings

dn46/go-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go-Shell

Go-Shell is a simple shell implemented in Go. It supports basic commands, navigation with cd, and exiting with exit.

Features

  • Execute any command available in the PATH
  • Navigate directories with cd
  • cd with no arguments returns to the home directory
  • Exit the shell with exit
  • Colored output for username, hostname, and current directory

Usage

To run the shell, simply execute:

make run

Code Structure

  • Shell: The main shell struct that contains a reader to read input from the user.
  • Run: The main loop of the shell that prints the prompt, reads input, and executes the input.
  • execInput: A function that takes a string input, parses it, and executes the command.

Acknowledgements

This project is inspired and based on Writing a simple shell in Go found on this blog post. Give love to the author for making it available.

License

MIT

About

Go-Shell is a simple shell implemented in Go. It supports basic commands, navigation with `cd`, and exiting with `exit`.

Topics

Resources

License

Stars

Watchers

Forks