AR20 2-1 FOSS Lab Syllabus
AR20 2-1 FOSS Lab Syllabus
(Autonomous)
(Approved by AICTE, New Delhi, Permanently Affiliated to JNTU Kakinada,
Accredited by NBA & Accredited by NAAC with A grade)
FOSS Lab
AR20 - B. Tech. (Common to CSE & All Specializations)
II - B. Tech., I-Semester
L T P C
0 0 3 1.5
Course Outcomes:
By the end of the course, the student will:
Identify and apply various Linux commands.
Create a new file from scratch or edit an existing file using vi editor.
Develop shell scripts for specific needs.
Develop awk scripts for specific needs.
LAB EXPERIMENTS
4. a) Write a shell script (small calculator) that adds, subtracts, multiplies and divides the two
given numbers. There are two division options: one returns the quotient and the other
remainder. The script requires three arguments: the operation to be used and the two
integers. The operation is specified by options:
Add -a
Subtract-s
Multiply -m
Quotient -c
Remainder –r
b) Write a shell script to accept student number, name, and marks in five subjects. Find total,
average and grade.
Rules:
Avg>=80 then grade A
Avg<80&&Avg>=70 then grade B
Avg<70&&Avg>=60 then grade C
Avg<60&&Avg>=50 then grade D
Avg<50&&Avg>=40 then grade E
Else grade F
c) Write a shell script to find the GCD of two given numbers.
7. a) Write a shell script to print all the primes below a given number is a prime number.
b) Write a shell script to print the first ‘n’ Fibonacci numbers.
c) Write a shell script which displays the list of all files in a given directory.
8. a) Write a shell script to sort elements of given array by using selection sort.
b) Write a shell script to search given number using binary search.
9. a) Write a sed command that deletes the first character in each line in a file.
b) Write a sed command that deletes the character before the last character in each line in a
file.
c) Write a sed command that swaps the first and second words in each line in a file.
10. a) Write an awk program to print sum, avg of students marks list
b) Write an awk program to display students pass/fail report.
c) Write an awk program to count the no. of vowels in a given file.