A simple UNIX command interpreter using C programming.
This project creates a simple shell, which is a computer program that exposes an operating system's services to a human user or other programs. The simple shell is written in C language and provides a command-line interface for interacting with the operating system.
To use the Simple Shell script, follow these steps:
- Clone the repository to your local machine.
- Compile the shell script using a C compiler, such as GCC. Using the options
-Wall -Werror -Wextra -pedantic -std=gnu89
- Run the compiled binary to start the shell.
Write a beautiful code that passes the Betty checks
Write a UNIX command line interprete
Handle command lines with arguments
Handle the`PATH`
Simple shell 0.3 +
Implement the`exit` built-in, that exits the shell
Simple shell 0.4 +
- Implement the
env
built-in , that prints the current environment
Simple shell 0.1 +
- Write your own
getline
function - Use a buffer to read many chars at once and call the least possible the
read
system call - You will need to use
static
variables
Simple shell 0.2 +
- You are not allowed to use
strtok
Simple shell 0.4 +
- handle arguments for the built-in
exit
- Usage:
exit status
, wherestatus
is an integer used to exit the shell
Simple shell 1.0 +
Implement the setenv
and unsetenv
builtin commands
Simple shell 1.0 +
Implement the builtin command cd
Simple shell 1.0 +
- Handle the commands separator
;
Simple shell 1.0 +
- Handle the
&&
and||
shell logical operators
Simple shell 1.0 +
- Implement the
alias
builtin command - Usage:
alias [name[='value'] ...]
Simple shell 1.0 +
- Handle variables replacement
- Handle the
$?
variable - Handle the
$$
variable
Simple shell 1.0 +
- Handle comments (
#
)
Simple shell 1.0 +
- Usage:
simple_shell [filename]
- Your shell can take a file as a command line argument
- The file contains all the commands that your shell should run before exiting
- The file should contain one command per line
- In this mode, the shell should not print a prompt and should not read from
stdin