OS Lab Manual
OS Lab Manual
DEPARTMENT OF
INFORMATION & TECHNOLOGY
LAB MANUAL
OPERATING SYSTEM
SHREE PAREKH ENGINEERING COLLEGE
MAHUVA
CERTIFICATE
Date:
27/03/2025
19/12/2024
26/12/2024
02/01/2025
09/01/2025
AIM 1 : To Demonstrate WSL (Windows subsystem for Linux) Feature on Windows 11.
Step 1 : Click Start Button and Search ‘Control Panel’ and Click Control Panel Icon.
Step 2 : Click on ‘Program’.
Step 5 : Then Show a Dialog Box, and Click on the ‘Hype-V’ Check Box.
Step 6 : Click the ‘Windows Subsystem for Linux’ Check Box.
Step 7 : Type on Keyboard ‘Windows Key + R’, and type “CMD”.
Step 14 : After Successfully user name and password created, Welcome page of ubuntu.
Step 15 : Type this Command for update “wsl --update”.
Variables in shell scripting are containers for storing necessary information. In Bash Script, declare
a variable by assigning a value to its reference by = operator. Furthermore, print the assigned values
using echo $(VARIABLE_NAME).
OUTPUT :
AIM 4 :
To concatenate multiple variables and store them into a single variable.
To concatenate multiple variables and store them into a single variable, enclose them with a double
quotation (“ ”) and then write the variables within {} consecutively. Here is an example:
OUTPUT :
AIM 5 :
To Perform Arithmetic All Operation Using Scripting.
Addition : Run an addition operation using the + operator between defined variables and enclose
them with $(). Here’s an example.
Output :
Subtraction : Subtract two numbers using the - operator between defined variables and enclose
them with $(). Here’s an example.
Output :
Division : Run a division using the / operator between defined variables and enclose them with $().
Here’s an example script.
Output :
AIM 6 :
Calculate The Area Of A Rectangle.
Write the formula to calculate the area of a rectangle inside the function Area() and call it by passing
the height and width.
Output :
AIM 7 :
Check If A Number Is Even Or Odd.
If a number is even, then its remainder after dividing by 2 will be 0. Otherwise, the number is odd.
So, use the remainder operator % within if-else to check if a number is even or odd. Here’s how.
Output :
Output :
AIM 9 :
Calculate The Factorial Of A Number.
Output :
Output :
AIM 12 :
Check If A Number Is Prime.
Create the Prime() function that returns whether the parameter passed is prime or not. Here is the
script.
Output :