Вы находитесь на странице: 1из 7

Subject: UNIX & Shell Programming Subject Code: BSIT - 43

Assignment: TB (Compulsory)

PART - A
1. What are the different standard given by POSIX ? What is POSIX ?
POSIX standards are formally designated as IEEE 1003 and the international standard name is ISO/IEC 9945. The standards, formerly known as IEEE-IX, emerged from a project that began circa 1985. Richard Stallman suggested the name POSIX in response to an IEEE request for a memorable name.[2]

POSIX :POSIX or "Portable Operating System Interface for Unix"[1] is the name of a family of related standards specified by the IEEE to define the application programming interface (API), along with shell and utilities interfaces, for software compatible with variants of the Unix operating system, although the standard can apply to any operating system.

5. What happens if a directory permission changed?

if a directory permission changed then the user or Group or other may not be Read, Write or Execute by changing the permission using commands such as -rw-r--r--, chmod etc.
Read (r) Write (w) Execute (x)

TABLE 1. UNIX DIRECTORY Permissions WHO USER Read (r) Write (w) Execute (x) GROUP Read (r) Write (w) Execute (x) WHAT THE PERMISSIONS ALLOW The account owner can list the files in the directory. The account owner can create or delete files in the directory. access files in that directory by name (such as Web page files). Everyone in the designated group can list the files in the directory. Everyone in the group can create or delete files in the directory. Everyone in the group can change (cd) into the directory and access files in that directory by name (such as Web page files). Anyone can list the files in the directory. Anyone can create or delete files in the directory. Anyone can change (cd) into the directory and access files in that directory by name (such as Web page files).

OTHER Read (r) Write (w) Execute (x)

4. What is script command, with command explain how to create script file of a session?

script is used to take a copy of everything which is output to the terminal and place it in a log file.
% less hw0.scr Script started on Wed Sep 06 09:34:14 2000 % ls hw0.scr square.scm

% cat square.scm ;; your name ;; your id ;; your section # or time ;; square takes a number as an input parameter and ;; returns the square of it. (define (square x) (* x x)) % module load soft/tcl % stk Welcome to the STk interpreter version 4.0.1 [SunOS-5.7-sun4] Copyright 1993-1999 Erick Gallesio - I3S - CNRS / ESSI STk> (load "square.scm") STk> square #[closure arglist=(x) 11b158] STk> (square 3) 9 STk> (square -5) 25 STk> (square 0.1) 0.01 STk> (square 0.00000001) 1e-16 STk> (square 'a) *** Error: *: not a number: a STk> (square 1) 1 STk> (square (square 3)) 81 STk> (exit)

% exit script done on Wed Sep 06 09:35:20 2000

6. How do you yank and paste lines?


The command 'Y' or 'yy' copies (yanks) one or more lines. To copy one line, two lines, 10 lines, and all lines to the end of the file, respectively: Y 2Y 10Y yG To paste the text contained in the buffer above (uppercase P) or below the current cursor position (lowercase p), respectively: P p It is also possible to yank text within a line. The following commands yank text from the current cursor position to the end of the word and the end of the line, respectively: yw y$ The same commands paste the text within a line. Lower case p pastes after the cursor position and upper case P pastes before. Paste will also work with deleted text, either lines or parts of lines. Be careful not to execute any other commands prior to pasting as this will empty the buffer.

9. Write general syntax of CASE statements.


The basic syntax of the case...esac statement is to give an expression to evaluate and several different statements to execute based on the value of the expression. The interpreter checks each case against the value of the expression until a match is found. If nothing matches, a default condition will be used.
case word in pattern1) Statement(s) to be executed if pattern1 matches ;; pattern2) Statement(s) to be executed if pattern2 matches ;; pattern3) Statement(s) to be executed if pattern3 matches ;; esac

10. What is a process ? Name two important attributes of a process.


A process under unix consists of an address space and a set of data structures in the kernel to keep track of that process. The address space is a section of memory that contains the code to execute as well as the process stack.

Two important attributes of a process:PID - The PID stands for the process identification. This is a unique number that defines the process within the kernel. PPID - This is the processes Parent PID, the creator of the process.

Вам также может понравиться