Skip to content

komerela/simple_shell

Repository files navigation

C PROGRAMMING – Simple Shell Project

Just a shell (courtesy Gregory Culmer

Description

What you should learn from this project:

  • Who designed and implemented the original Unix operating system? Dennis Ritchie, Doug McIlroy, and Peter G. Neumann also credit Kernighan.
  • Who wrote the first version of the UNIX shell? Ken Thompson
  • Who invented the B programming language? Ken Thompson & Dennis Ritchie
  • Who is Ken Thompson? An original developer of the Unix Shell
  • How does a shell work?
  • What is a pid and a ppid?
  • Learn how to manipulate the environment of the current process.
  • What is the difference between a function and a system call?
  • Learn how to create processes.
  • How does the shell use the PATH to find the programs?
  • Learn how to execute another program with the execve system call.
  • Learn how to suspend the execution of a process until one of its children terminates.
  • What is EOF / “end-of-file”?
  • What are the three prototypes of main?
    • int main(void)
    • int main(int ac, char **av)
    • int main(int ac, char **av, char **env)
  • A README file that describes the simple shell project
  • This file contains the functions utilized in our Shell program
  • This file details contacts of the authors of this shell project
  • A beautiful code that passes the betty checks.
  • Write a UNIX command line interpreter.
  • What should your shell do?
    • Display a prompt and wait for the user to type a command. A command line always ends with a new line.
    • The prompt is displayed again each time a command has been executed.
    • The command lines are simple, no semicolons, no pipes, no redirections or any other advanced features.
    • The command lines are made only of one word. No arguments will be passed to programs.
    • If an executable cannot be found, print an error message and display the prompt again.
    • Handle errors
    • You have to handle the “end of file” condition(Ctrl + D)
  • Test the file in C
  • Our 0.1+ shell can handle command lines with arguments
  • Our 0.2+ simple shell can handle the PATH
  • Implement the exit built in that exits the shell 0.3+
  • Implement the shell build in, that prints the current environment
  • Write a blog post describing step by step what happens
  • Blog post should contain the following
    • Have at least one picture, at the top of the blog post
    • Publish your blog post on Medium or LinkedIn
    • Share your blog post at least on Twitter and LinkedIn
    • Only one blog post by team
    • The blog post must be done and published before the first deadline
    • Please, remember that these blogs must be written in English to further your technical ability in a variety of settings
  • Remember to add the URLs for blog post and tweet

Resources

  1. https://cvw.cac.cornell.edu/Linux/howwork
  2. https://stackoverflow.com/questions/30493424/what-is-the-difference-between-a-process-pid-ppid-uid-euid-gid-and-egid
  3. https://www.quora.com/What-is-the-difference-between-a-function-call-and-a-system-call-in-an-operating-system
  4. Shout outs!

    1. [Drew](https://github.com/dmaring) - Effective usage of builtin GDB
    2. [Ben](https://github.com/VieetBubbles) - Understanding Parent & child
    3. [Farrukh](https://github.com/narnat) - Working with arrays
    4. [Tim](https://github.com/tassavarat) - Debugging accomodating newline
    5. [Arthur](https://github.com/arthurdamm) - Debugging our PWD error

    Authors

About

Simple UNIX command interpreter - Shell

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages