Skip to content

AbhishekSinghDhadwal/LinuxShellInC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

LinuxShellInC

Simple Linux Shell written in C for OS-Assignment -1. Follows these parameters provided by our guidelines :

Assignment 1 Problem statement: Write your own command shell using OS system calls (fork, wait, exec, etc) to execute built-in Linux commands. Your command shell should support below listed features.

  1. The prompt you print should indicate the current working directory followed by ‘$’ character. It may also indicate other information like machine name or username or any other information you would like.
  2. Your shell should support ‘cd’ command. The command ‘cd ’ should change its working directory and ‘cd ..’ should take you to the parent directory.
  3. An incorrect command format (which your shell is unable to process) should print an error message ‘Shell: Incorrect command’. If your shell is able to execute the command, but the execution results in error messages generation, those error messages must be displayed to the terminal. An empty command should simply cause the shell to display the prompt again without any error messages.
  4. Your shell should support multiple commands separated by ‘&&’ or ‘&&&’. The commands should be executed sequentially when separated by ‘&&’ and the commands should be executed in parallel when separated by ‘&&&’. Also your shell must wait for all the commands to be terminated before accepting further inputs.
  5. Your shell should be able to handle signals generated by ‘Ctrl + C’ and ‘Ctrl + Z’. So, when these signals are generated, your shell should continue to work and the commands being executed by the shell should respond to these signals. Your shell should stop only with ‘exit’ command.
  6. Your shell should be able to redirect STDIN and STDOUT for the commands using ‘<’ and ‘>’. For example, ‘./a.out < data.in’ should cause the executable to access data from ‘data.in’ file and ‘ls > info.out’ should write the output of ‘ls’ command to ‘info.out’ file.

About

Simple Linux Shell written in C for OS-Assignment -1.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages