How the Unix shell runs a program?

Member

by jewel , in category: General Help , a year ago

How the Unix shell runs a program?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lonzo , a year ago

@jewel The Unix shell is one of the main components of a Unix System. There are 3 major components, the other two being the kernel, and programs.


The kernel is the brain box of the Unix operating system. It organizes everything for the operating system like allocating time and memory to programs, handling communication between various subsystems and components in the computer, and also handling the file structure.


The programs are mostly application software that runs logical sequences of commands in order to accomplish a particular task.


The shell on the other hand is also referred to as terminals. They can create a terminal session for running our programs. A shell can open up another sub-shell.


The way shell works are that they allow us to send some command to the kernel to run some programs. The following demonstrates how a shell, together with a kernel allows us to execute a program.

  • The user types and runs some kernel commands.
  • The shell finds the program and instructs the kernel to run the program
  • The kernel completes its job, returns control back to the shell and the shell displays the result.

Note that there is more than one type of shell program for the various UNIX flavors.