A simple Unix-like shell implemented in C. It supports command execution, pipelines, redirection, background execution, and built-in commands like cd, exit, clear, help, history, set, and unset.
- GNU Readline Library
- On Ubuntu, install it with:
sudo apt-get update sudo apt-get install libreadline-dev
- On Ubuntu, install it with:
- GCC Compiler
- Prompt: Displays the current user and working directory.
- Command Parsing:
- Pipelines (
|) - Input (
<) and output (>) redirection - Background execution (
&) - Quoted arguments and environment variable expansion (
$VAR)
- Pipelines (
- Built-in Commands:
cd: Change the current directory.exit/bye: Exit the shell.clear/cls: Clear the terminal.help: Display help information.history: Show command history.set VAR=value: Set an environment variable.unset VAR: Unset an environment variable.
- History Support: Command history is managed with GNU Readline.
- Error Handling: Syntax and execution errors are reported to the user.
Compile and run the project with the following command:
g++ nova.c main.c -o nova -lreadline && ./nova
When you run Nova Shell, you'll see a welcome banner and a prompt displaying your current directory. You can then type commands as in any Unix shell. For example:
- List files:
ls -l - Execute a pipeline:
ls | grep "txt" - Redirect output:
ls > files.txt - Run a background process:
sleep 10 &
To see all available commands, type help.
This project is released under the MIT License.
Imran AKKI