0% found this document useful (0 votes)
29 views3 pages

Lab03_CT104H

The document outlines the requirements for Lab #3 of the Operating Systems course at Can Tho University, including submission format and instructions for creating a report. It lists a series of shell scripting tasks that students must complete, such as printing messages, performing calculations, and creating directories. Students are also instructed to provide commands, scripts, and screenshots in their report.

Uploaded by

t0913967026
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)
29 views3 pages

Lab03_CT104H

The document outlines the requirements for Lab #3 of the Operating Systems course at Can Tho University, including submission format and instructions for creating a report. It lists a series of shell scripting tasks that students must complete, such as printing messages, performing calculations, and creating directories. Students are also instructed to provide commands, scripts, and screenshots in their report.

Uploaded by

t0913967026
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/ 3

CT104H – Operating System

CAN THO UNIVERSITY


COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGY
OPERATING SYSTEMS (CT104H)
LAB #3

Student name: ID:

- Submission: Students submit 1 file named StudentName_ID_CT104H_Lab03.pdf to the Google classroom


(where StudentName is the student’s name, and ID is the student’s ID).
- Instructions on how to present in the report file
⮚ For each question, students MUST provide the commands/scripts AND screenshots of the commands
used and/or the content of files/scripts, CLEARLY. Note: the screenshot needs to include the name of
the Ubuntu Virtual machine.
⮚ Student creates an Ubuntu Virtual machine named UbuntuID (ID is the student’s ID). For example, we
have a virtual machine named Ubuntu20043, such that the student ID is 20043.
Question 0: Navigate to your home directory
Answer: $cd

Study from the files: Linux Shell Scripting Tutorial, and Shell Script (Chapter 2, 3), Advanced Bash-Scripting
Guide (Chapter 13)
CT104H – Operating System
Question 1: Write a shell script that prints the message “Hello ! This is CT104” to the screen.
Question 2: Modify the shell script from Question 1 to include a variable. The variable will hold the content
of the message.
Question 3: Write a shell script that prints the following information to the screen
Today is <current date>
Hello <username>
Your current working directory is <current directory>
Your home directory is <home directory>
Please press any key to finish <wating to receive a key from user>
********* Thank you
Question 4: Write a shell script that receives 2 numbers from a user, and calculates the following values
Please input the first number: x = x
Please input the second number: y = y
(x-y) = <x-y>
(x+y) = <x+y>
(x*y) = <x*y>
(x/y) = <x/y>
(x%y) = <x%y>
x2= x2
x! = x!
Question 5: Write a shell script that allows a user to input a name of a directory, and creates this directory for
the user. If the directory is created, please print the message “The name_of_directory is created successfully”
to the screen; otherwise, print the message “Can not create the name_of_directory” to the screen.
Question 6: Write a script to print the following symbols to the screen
*
**
***
****
*****
******
*******
********
*********
**********
CT104H – Operating System

1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5

Question 7: Write a shell script to solve the equation ax+b=0 where the coefficients a and b entered from the
keyboard
Question 8: Write a shell script to print a multiplication table of a number entered by the user to the screen.
After printing out the multiplication table, the program will ask the user to type “1” if the user wants to continue
the process; otherwise, the process of printing the multiplication table will end.
Question 9: Write a shell script that allows users to input an int number and returns the digit number of that
number. For example, 10 → returns “two-digit number”; 100 → returns “three-digit number”.
----------------------END----------------------

You might also like