MCA 307: Unix Shell Programming Lab
Lectures: 6 Periods/Week | Sessional Marks: 30 |
University Exam: 3 Hours | University Examination Marks: 70 |
UNIT-I
Lab Cycle
- Write a shell script to accept two numbers and perform all arithmetic operations on it.
- Write a shell script to find largest of three numbers using conditional execution operators.
- Write a shell script to check whether a particular user has logged in or not. If he has logged in, also check whether he has eligibility to receive a message or not.
- Write a shell script to accept the name of the file from standard input and perform the following tests on it
- File executable
- File readable
- File writable
- Both readable & writable
- Write a shell script which will display the username and terminal name who login recently in to the unix system.
- Write a shell script to find no. of files in a directory.
- Write a shell script to print the following format. 1 12 123 1234
- Write a shell script to print prime numbers up to a given range using arguments.
- Write a shell script which will display the number of days in the given month and year.
- Write a shell script to check whether a given number is perfect or not.
- Write a menu driven shell script to copy, edit, rename and delete a file.
- Write a shell script for concatenation of two strings.
- Write a shell script which will display Fibonacci series up to a given number of argument.
- Write a shell script to accept student number, name, marks in 5 subjects. Find total, average and grade. Display the result of student and store in a file called stu.dat. 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
- Write a shell script to accept empno,empname,basic. Find DA,HRA,TA,PF using following rules. Display empno, empname, basic, DA,HRA,PF,TA,GROSS SAL and NETSAL. Also store all details in a file called emp.dat Rules: HRA is 18% of basic if basic > 5000 otherwise 550 DA is 35% of basic PF is 13% of basic IT is 14% of basic TA is 10% of basic
- Write a shell script to demonstrate break and continue statements.
- Write a shell script to satisfy the following menu options.
- Display current directory path
- Display todays date
- Display users who are connected to the unix system
- Quit
- Write a shell script to delete all files whose size is zero bytes from current directory.
- Write a shell script to display string palindrome from given arguments.
- Write a shell script which will display Armstrong numbers from given given arguments.
- Write a shell script to display reverse numbers from given argument list.
- Write a shell script to display factorial value from given argument list.
- Write a shell script which will find maximum file size in the given argument list.
- Write a shell script which will greet you “Good Morning”, ”Good Afternoon”, “Good Evening’ and “Good Night” according to current time.
- Write a shell script which will display total size of directories.
- Write a shell script to sort the elements in a array using bubble sort technique.
- Write a shell script to find largest element in a array.
- Write an awk program for display the lines in any file centre alignment.
- Write an awk program to print sum, avg of students marks list.
- Write an awk program to display total number of users and their names in unix system.
- Write an awk program to display students pass/fail report.
- Write an awk program to count the no. of vowels in a given file.
- Write an awk program which will find maximum word and its length in the given input File.
- Write a shell script to generate the mathematical tables.
- Write a shell script to check whether given number is strong or not.
- Write a shell script to sort elements of given array by using selection sort.
- Write a shell script to search given number using binary search.
- Write a shell script to find number of vowels, consonants, numbers, white spaces and special characters in a given string.
- Write a shell script to lock the terminal.
- Write a shell script which merge the contents of file1, file2, file3, sort them and display the sorted output on the screen page by page.