This section will briefly and naively present Go code that can be used as the foundation for the development of a Unix shell. Apart from the exit command, the only other command that the program can recognize is the version command that just prints the version of the program. All other user input will be echoed on the screen.
The Go code of UNIXshell.go will be presented in three parts. However, before that I will present to you the first version of the shell, which mainly contains comments in order to better understand how I usually start the implementation of a relatively challenging program:
package main import ( "fmt" ) func main() { // Present prompt // Read a line // Get the first word of the line // If it is a built-in shell command, execute the command // otherwise, echo the command }...