Skip to content

This is a simple shell implementation in C, similar to Bash, that allows users to execute basic commands and run programs. The shell supports input and output redirection, piping, and background processes.

Notifications You must be signed in to change notification settings

SherneVK/simple_shell

Repository files navigation

Simple Shell

Overview

  • A shell is a command line interface(CLI) that allows users to interact with an Operating System(OS) by entering commands. It takes user input, interprets it, and executes the corresponding system calls to perform tasks like running programs, managing files, etc.

Features

Motivation

Building a shell is a valuable learning experience. To gain a deeper understanding of the inner workings of how the shell operates including process management, I/O handling, and interaction with the kernel (Core part of the OS).

Compilation

gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c -o hsh 

Usage

Interactive mode: ./hsh

Non-interactive mode: echo "/bin/ls" | ./hsh

Examples

  • Run shell in interactive mode:
 $ ./hsh
 #cisfun$ ls -l
 $ ./hsh
 #cisfun$ pwd
 /home/{username}/{dir}/simple_shell
 $ /hsh
 #cisfun$ echo “Hello, World!”
 “Hello, World!
  • Run shell in non-interactive mode:
 $ echo "/bin/ls" | ./hsh
 exec.c interactive.c hsh read_line.c non_interactive.c shell.c  read_stream.c  tokenize.c
 process.c shell.h
 $ echo "pwd" | ./hsh
 /home/{username}/{dir}/simple_shell

Reference

Contributors

This project was jointly created by @SherneVK and @droffilc1

About

This is a simple shell implementation in C, similar to Bash, that allows users to execute basic commands and run programs. The shell supports input and output redirection, piping, and background processes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages