0% found this document useful (0 votes)
11 views11 pages

Laab 2

The document outlines the objectives and requirements for a SHELL Programming lab session, focusing on understanding and practicing SHELL scripts. It includes details on the types of SHELLs in UNIX, the purpose of SHELL scripts, and examples of script commands. Additionally, it provides assessment rubrics for evaluating the lab submissions based on correctness, delivery, coding standards, and presentation.

Uploaded by

mranees5323
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views11 pages

Laab 2

The document outlines the objectives and requirements for a SHELL Programming lab session, focusing on understanding and practicing SHELL scripts. It includes details on the types of SHELLs in UNIX, the purpose of SHELL scripts, and examples of script commands. Additionally, it provides assessment rubrics for evaluating the lab submissions based on correctness, delivery, coding standards, and presentation.

Uploaded by

mranees5323
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

SHELL Programming (Part I)

Lab #02

Spring 2022
SHELL Programming (Part I)
Submitted by: Waqas Atta
Registration number: 22PWCSE2142
Class Section: B

“On my honor, as student of University of Engineering and Technology, I have neither given nor
received unauthorized assistance on this academic work.”

Student Signature: _____________

Submitted to:
Engr. Abdullah
March 15th, 2023

Department of Computer Systems Engineering University of Engineering and


Technology, Peshawar
Title:
SHELL Programming (Part I) Objectives
of the lab:

The aim of this laboratory is to learn and practice SHELL scripts by writing small SHELL
programs.
The following are the primary objectives of this lab session:

✓ Understanding what is a SHELL script


 What is a SHELL script?
 Different kinds of SHELLs in UNIX
 Why and where it is used
 First simple SHELL script
 SHELL variables
 User defined variables
 System variables
 Read only variables and wiping out variables
 Assigning values to variables
 Reading input Shell:

A shell is a command line interpreter. It takes commands and executes them. As such, it
implements a programming language. Three most widely used shells in UNIX are Bourne
shell, C shell, and Korn shell.

Shell scripts:
A shell script or a shell program is a series of commands put in a file and executed by the
Shell. We will use shell to create shell scripts.

Why Shell scripts?


Since the user cannot interact with the kernel directly, Shell programming skills are a must to be
able to exploit the power of UNIX to the fullest extent. A shell script can be used for variety of
tasks and some of them are listed below.
ls
who
pwd

Save the file and type the file name in command line and the file is executed as follows.

Figure 1: Terminal

Figure 2: script file


echo What is your name\? read

name, echo Welcome $name.

This prompts the user for input, assigns this to the variable name and then displays the

value of this variable to standard output.

Figure 3: Terminal
Figure 4: script file

echo "Please enter your surname\n"


echo "followed by your first name: \c"
read name1 name2

echo "Welcome to CSE Dept., UET, $name2 $name1"


Figure 5: Terminal

Figure 6: script file

echo “Please Enter source file name: \c”


read source echo “Enter the target file
name :\c” read target cp $source $target
echo file $source is copied into the $target

Figure 7: Terminal
Figure 8: Script file

a=12 b=90 echo sum is $a + $b # Will display

sum is 12 + 90

echo sum is `expr $a + $b` # Gives sum is 102

Figure 9: terminal
Figure 10: Script
CSE 302L: Operating Systems Lab

LAB ASSESSMENT RUBRICS

Marking Does not meet


Exceeds expectation Meets expectation
expectation Score
Criteria (2.5) (1.5)
(0)
Program compiles
Program compiles (no Program fails to or
(no errors and no
errors and some compile with lots of
warnings).
warnings). warnings.
Some details of the
Program always
program specification Program only functions
works correctly and
1. Correctness are violated, program correctly in very limited
meets the
functions incorrectly cases or not at all.
specification(s).
for some inputs.
Completed between 41- Completed less than
Completed between
80% of the 40% of the
81-100% of the
requirements. requirements.
requirements.
Delivered on time,
and in correct Not delivered on time, Not delivered on time
2. Delivery format (disk, email, or slightly incorrect or not in correct format.
hard copy etc.) format.

Proper indentation, Poor use of whitespace,


whitespace, line Missing some of
line length, wrapping,
3. Coding length, wrapping, whitespace, line length,
comments and
Standards comments and wrapping, comments or
references.
references. references.

Includes name,
date, and
assignment title. No name, date, or
Includes name, date,
Task titles, assignment title
and assignment title.
objectives, output included.
4. Presentation Task titles, objectives,
screenshots No task titles, no
of document output screenshots
included and good objectives, no output
included and good
formatting and screenshots, poor
formatting.
excellently formatting.
organized.

Instructor:

Name: Engr. Abdullah Hamid Signature: ______________________

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy