Featured Post

Wednesday, March 30, 2016

Shell Programs to be exercised



PROGRAM NUMBER
PROGRAM  NAME
1
Write a shell script to check whether a particular user has logged in or not.

2
Write a shell script to accept the name of the file from standard input and perform the following tests
on it
a)      File executable b) File readable c) File writable d) Both readable & writable


3
Write a shell script which will display the username and terminal name who login recently in to the unix system.

4
Write a shell script to find no. of files in a directory.

5
Write a shell script to check whether a given number is perfect or not
.
6
Write a Shell program to check whether given number is prime or not.

7
Write a shell script which will display Fibonacci series up to a given range.

8
Write a shell script for concatenation of two strings

9
Write a Shell program to reverse a given string

10
Write a shell script to display check whether the given string is palindrome or not.

11
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


12
Write a shell script to accept employee number ,employee name basic. Find DA,HRA,TA,PF using following rules. 
Display employee number , employee name, 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.

13
Write a shell script to demonstrate  break and  continue statements.


14
Write a shell script to satisfy the following menu options
a. Display current directory path
b. Display today’s date
c. Display users who are connected to the unix system
d. Quit


15

Write a Shell program to find gcd of 2 numbers

16
Write a shell script to generate the mathematical tables.

17
Write a shell script to check whether the given number is Armstrong
or not
18

Write a shell script to check whether a number is palindrome or not .

19
Write a shell script to find the value of ncr

20
Write a shell script which will greet you “Good Morning”, ”Good Afternoon”, “Good Evening” and “GoodNight” according to current
time.
21
Write a shell script to sort the elements in a array using bubble sort technique.

22
Write a shell script to find smallest and largest element in a array.

23
Write a shell script to search given number using linear search.

24
Write a shell script to search given number using binary search.

25
Write an awk program to print sum, avg of students marks list.

26
Write an awk program to display students pass/fail report.

27
Write an awk program to count the no. of characters in a given file




                                           http://cjuschools.blogspot.in/



Unix operating system Linux operating system shell programming bourn shell kourne shell c shell difference between unix and linux operating system , history of UNIX, red hat operating system. UNIX OS architecture , kernel utility programs , file handling process handling inter process communication pipes shared memory message queues socket programming TCP/IP , UDP programming , One to One chat Application , Basic shell program to add two numbers , echo function , while loops clear gt lt le ge ne eq if fi while do done case array in unix strings , cut copy paste cat dir pwd getcwd chdir command read write stat lseek fstat flock mechanism.even or add program vi editor command ni vi editor command mode esc mode insert mode aa dd x :q :wq :wSystem calls. Pipes,mkdir,chdir,open read pipe,shmget,shmat ,msgctl,msgsnd msgrecv, system calls. foss lab, unix lab, JNTUK foss lab, list of lab programs for foss, awk script linear search binary search bubble sort in shell Write a shell script to check whether a particular user has logged in or not.Write a shell script to search given number using linear search. Write an awk program to print sum, avg of students marks list. Write an awk program to display students pass/fail report. Write an awk program to count the no. of characters in a given file Write a shell script to sort the elements in a array using bubble sort techniqueWrite a shell script to generate the mathematical tables.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 FWrite a shell script to accept employee number ,employee name basic. Find DA,HRA,TA,PF using following rules. Display employee number , employee name, 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 accept the name of the file from standard input and perform the following testson ita)      File executable b) File readable c) File writable d) Both readable & writable

No comments:

Post a Comment