https://github.com/codewithmide/simple_shell
Shell project
https://github.com/codewithmide/simple_shell
bash c linux makefile shell
Last synced: 4 months ago
JSON representation
Shell project
- Host: GitHub
- URL: https://github.com/codewithmide/simple_shell
- Owner: codewithmide
- Created: 2022-05-19T22:18:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-11T19:16:52.000Z (over 3 years ago)
- Last Synced: 2025-07-19T22:39:50.033Z (7 months ago)
- Topics: bash, c, linux, makefile, shell
- Language: C
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: history.c
- Authors: AUTHORS
Awesome Lists containing this project
README
## Description
This repo has our custom shell project, which attempts to replicate some of the
processes of the 'sh' shell or 'bash' shell.
For more information view the blog post of Ibrahim Morketa & Simegnew Misganaw
[here](https://medium.com/@ibrahimbsc8/simple-shell-a-custom-shell-command-line-interpreter-a0d11d5b219f)
### C language standard functions and system calls utilized
`access`, `chdir`, `close`, `closedir`, `execve`, `exit`, `fork`,
`free`, `fstat`, `getcwd`, `getline`, `kill`, `lstat`, `malloc`,
`open`, `opendir`, `perror`, `read`, `readdir`, `signal`, `stat`,
`strtok`, `wait`, `waitpid`, `wait3`, `wait4`, `write`, `_exit`
## Brief Synopsis
All files in this repository are designed to compile with GNU compiler
collection '`gcc`' in the linux environment from '`Ubuntu 20.04
LTS`'. When compiled, the executable file replicates a 'shell' or command line
interpreter, which is a user interface used for access to an operating system's
services. This shell has a set of custom built-in commands, and also integrates
with other commands located in the system's PATH. Output and functionality from
commands is designed to replicate output from the shell `sh` (dash) and some
bash commands.
## Usage
### compile
```
$ gcc -Wall -Werror -Wextra -pedantic *.c -o hsh
```
**Compile with Make**: `make all`
### executing the program
**interactive mode**: `$ ./hsh`
**non-interactive mode**: `$ echo "ls -la" | ./hsh`
### usage of arsine in interactive mode
Here is an example usage of the ls
command with flags. This command lists directory contents.
```
$ ls -la
```
## Ref
* Olumide Micheal Tolulope
* Ahmed Gbadamosi