Skip to content

JasonCheeeeen/Fork_and_Shell_in_os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published