Bahria University, Lahore Campus Department of Computer Sciences Lab Journal 03 Course: Operating System Lab Date:26/2/2020 Course Code: CSL - 320 Max Marks: 20 Faculty’s Name: Sir Zia Lab Engineer: Sarah Chaudhry Name: Muhammad Saad Enroll No: 03-135182-012 Objective(s) : To understand LINUX shell programming variables, wildcards, expressions and control structures. Lab Tasks : Task 1: Write the output of programs for LINUX variables.
Task 2: Write a program to calculate the addition, subtraction, multiplication and division of numbers.
Task 3.1: Write a program that compares two numbers if a is greater than b it displays “a is greater than b”, otherwise it displays that ‘a is not equal to b’.
Task 3.2: Write a program that compares two numbers check whether the numbers are equal, a is greater than b or a is less than b.
Task 4 : Write a program using “case” that inputs a fruit from the user and displays “Apple pie” on the input of apple, “I like banana” on the input of banana and “New Zealand famous for kiwi” on the input of kiwi.
Lab Grading Sheet : Task Max Marks Obtained Marks Comments( if any ) 1. 5 2. 5 3. 5 4. 5 Total 20 Signature Note : Attempt all tasks and get them checked by your Lab. Instructor Lab 03: LINUX Shell Programming - I Objective(s): To understand LINUX shell programming variables, wildcards, expressions and control structures. Tool(s) used: Ubuntu, VIM Editor
Introduction Shell programming is a group of commands grouped together under single filename. After logging onto the system a prompt for input appears which is generated by a Command String Interpreter program called the shell. The shell interprets the input, takes appropriate action, and finally prompts for more input. The shell can be used either interactively - enter commands at the command prompt, or as an interpreter to execute a shell script. Shell scripts are dynamically interpreted, NOT compiled. Common Shells C-Shell - csh The default on teaching systems Good for interactive systems Inferior programmable features. Bourne Shell bash or sh - also restricted shell – bsh (The Bourne Again Shell) It was written by Steve Bourne. Over the years the original Bourne Shell has been expanded, but it remains the basic shell provided in many commercial versions of Linux.
- Spring '20
- Test, Shell script, C shell, General Shell Terminologies