An open API service indexing awesome lists of open source software.

https://github.com/ranimeshehata/simple-shell

Simple-Shell is a Linux based shell implementation written in C language. The shell provides a simple and efficient command line interface for users to interact with the operating system. The implementation of Simple Shell includes built-in commands and the ability to run external programs.
https://github.com/ranimeshehata/simple-shell

c linux operating-systems ubuntu

Last synced: 2 months ago
JSON representation

Simple-Shell is a Linux based shell implementation written in C language. The shell provides a simple and efficient command line interface for users to interact with the operating system. The implementation of Simple Shell includes built-in commands and the ability to run external programs.

Awesome Lists containing this project

README

          

# Simple-Shell (Multi-Processing)
## Objectives:
1. Familiarity with system calls in Unix environment.
2. Introduction to processes and multi-processing.
3. Introduction to signal handling in Unix environment.

## It is required to implement a Unix shell program. A shell is simply a program that conveniently allows you to run other programs. The shell supports the following commands:
1. The internal shell command "exit" which terminates the shell
2. A command with no arguments

Example: ls, cp, rm
3. A command with arguments

Example: ls –l
4. A command, with or without arguments, executed in the background using &.

Example: gedit &

Details: In this case, your shell must execute the command and return immediately, not blocking until the command finishes.

#### Requirements: Show that the opened process will be nested as a child process to the shell program via opening the task manager found in the operating system. Additionally, you have to write in a log file (basic text file) when a child process is terminated (main application will be interrupted by a SIGCHLD signal). So you have to implement an interrupt handler to handle this interrupt and do the corresponding action to it.
5. Shell builtin commands

Commands: cd & echo

cd: Cover all the following cases (assume no spaces in path):

* cd

* cd ~

* cd ..

* cd absolute_path

* cd relative_path_to_current_working_directory

echo: Prints the input after evaluating all expressions (assume input to echo must be within double quotations).
6. Expression evaluation

Commands: export

Details: Set values to variables and print variables values. No mathematical operations is needed.

Export Details: Accept input of two forms, either a string without spaces, or a full string inside double quotations.

### Compiling and Execution
![image](https://github.com/ranimeshehata/Simple-Shell/assets/121239735/6e7f7312-1d5a-4368-adb0-8dda42a59973)