Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 891 Bytes

README.md

File metadata and controls

32 lines (27 loc) · 891 Bytes

Fork and Shell in OS

In this project, you can see how to implement fork and shell simply.

Fork(C++)

There have two different examples.

  1. use wait(&) to control process parent and process child.
  2. without wait(&).

wait(&) -- means if process parent want to run, it need to wait process child has finished.

Ex:

  1. use wait
    I am a child, my name is 526852,
    and My dad's name is 526851.
    I have a brother, his name is 526853.
    Also, my grandpa's name is 526850.

  2. without wait
    My name is 526856.
    Grandpa's name is 526854
    Dad's name is 526855.
    Brother's name is 526857.

Shell(C)

In this program, it can run some standard pipe or CLI.
Ex:

  1. ls
  2. ls -a
  3. ls -l
  4. ls -al
  5. ls -al > output1 > output2 > output3
  6. ls -al < output1 < output2 < output3