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.
- Host: GitHub
- URL: https://github.com/ranimeshehata/simple-shell
- Owner: ranimeshehata
- Created: 2024-03-05T18:53:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-09T18:10:53.000Z (over 2 years ago)
- Last Synced: 2025-04-03T11:44:01.302Z (about 1 year ago)
- Topics: c, linux, operating-systems, ubuntu
- Language: C
- Homepage:
- Size: 7.66 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
