This project is a custom implementation of a command-line shell built with Go. It was developed as part of a coding challenge here. The shell provides basic command execution capabilities, along with history management and directory navigation.
- Execute common shell commands (
ls,pwd,cd, etc.). - Maintain a persistent command history across sessions.
- Use
cd -to switch to the previous directory. - Handle
Ctrl+Cgracefully without terminating the shell.
These instructions will help you set up and run the project on your local machine for development and testing.
- You need to have Go installed on your machine (Go 1.18 or later is recommended).
- You can download and install Go from https://golang.org/dl/.
Clone the repository to your local machine:
git clone https://github.com/nullsploit01/cc-shell.git
cd cc-shellCompile the project using:
go build -o cc-shellTo start the shell, run the compiled binary:
./cc-shell> pwd
/home/user
> ls
file1.txt file2.txt Documents/
> cd Documents
> pwd
/home/user/Documents
> cd ~
> pwd
/home/user
> cd -
/home/user/Documents
> history
1 pwd
2 ls
3 cd Documents
4 pwd
5 cd ~
6 pwd
7 cd -
> Ctrl+C
Ignored Ctrl+C. Use 'exit' to quit.
> exit
Exiting... Bye!go test ./...