Skip to content

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.

Notifications You must be signed in to change notification settings

ranimeshehata/Simple-Shell

Repository files navigation

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.

  1. 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).
  2. 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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages