Part I Answer the following questions 1 What are the differe

Part I: Answer the following questions 1. What are the differences among shell, kernel and API (Application Program Interface)? 2. What is the pipe mechanism in UNIX? And show one command using pipe and explain how the pipe works in it? 3. What are the UNIX attributes? Part II: Regular Expression 1. Chose match es for each given basic or extended regular expression (maybe multiple correct matches) eg. Extended regular expression: abta c)abba. d) a) ababa b) aba answer:be (Because matched string should begin and end with and \'b\'occurs at least once between leading and ending a Note: question 4) for regular expressions, question 5) to 12) are for extended regular expressions. 1) \'a(ab)*a\" (a) a(ab)a (b) aaba (c) aabab (d) aa(abab)aa (e) aa 2) \'a [bc] (a)azbc: 3) 0-9] (a) azz

Solution

Part 1

1) Shell is a part of Kernel. Shell is used as a interpreter. Interpreter(Shell) Converts commands into low level machine code and the the kernel takes action according to the request by shell. In simple terms shell is a thin layer of interface underlying the OS(Kernel). Shell is wrapper. And shell can be in any form, like file explorer in Windows, Command promt etc. While API\'s are the codes that use System calls to get work done by kernel.

2) Pipes are a source of data exchange between 2 processes, and sometimes output of one process is fed to input of another.

Eg popen and pclose functions.

FILE *popen(const char *command, const char *open_mode)

int pclose(FILE *stream_to_close)

The popen function allows a program to invoke anothe rprogram as a new process and either pass data to it or recieve data from it. The command string in above functions is name of the program to run together with any parameter.

When the process started with popen has finished you can close the file stream associated with it using pclose.

 Part I: Answer the following questions 1. What are the differences among shell, kernel and API (Application Program Interface)? 2. What is the pipe mechanism i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site