A custom shell environment written in Python. The Shell
supports basic built-in commands and can execute external commands from the system PATH
. This project serves as a lightweight shell environment, showcasing the fundamentals of shell programming and Python scripting.
The Shell
is a custom Python-based shell environment designed to handle common built-in commands such as echo
, pwd
, cd
, and more. Additionally, it allows execution of external commands available in the system's PATH
.
The shell is lightweight, making it a great starting point for learning shell programming or extending functionality for specific use cases.
- Built-in commands:
echo
,pwd
,cd
,type
, andexit
. - Command Execution: Supports running external commands from the system's
PATH
. - Error Handling: Provides feedback for invalid commands or directories.
- Cross-platform Compatibility: Runs on any system with Python 3.x.
- Python 3.6 or higher
-
Clone the repository:
git clone https://github.com/artpedro/shell-python.git cd shell-python
Run the shell locally using the provided script:
./your_program.sh
$ echo Hello, world!
Hello, world!
$ pwd
/home/user
$ cd /tmp
$ pwd
/tmp
$ exit 0
Command | Description |
---|---|
echo |
Prints the input string to the terminal. |
pwd |
Displays the current working directory. |
cd |
Changes the current directory. |
type |
Checks if a command is a shell built-in or external. |
exit 0 |
Exits the shell environment. |
artpedro-shell-python/
├── your_program.sh # Shell script to run the program
└── app/
└── main.py # Python implementation of the shell