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/ 2
1. Write a script to find the greatest of three numbers (numbers passed as command line parameters).
2. Write a script to check whether the given no. is even/odd.
3. Write a script to calculate the average of n numbers. 4. Write a script to check whether the given number is prime or not. 5. Write a script to check whether the given input is a number or a string. 6. Write a script to compute no. of characters and words in each line of given file. 7. Write a script to print the Fibonacci series up to n terms. 8. Write a script to calculate the factorial of a given number. 9. Write a script to calculate the sum of digits of the given number. 10. Write a script to check whether the given string is a palindrome. 11. Write a shell script that accepts a string from the terminal and echo a suitable message if it doesn’t have at least 5 characters including the other symbols. 12. Write a shell script to echo the string length of the given string as argument. 13. Write a shell script that accepts two directory names as arguments and deletes those files in the first directory which are similarly named in the second directly. Note: Contents should also match inside the files. 14. Write a shell script to display the processes running on the system for every 30 seconds, but only for 3 times. 15. Write a shell script that displays the last modification time of any file. 16. Write a shell script to check the spellings of any text document given as an argument. 17. Write a shell script to encrypt any text file. 18. Combine the above commands in a shell script so that you have a small program for extracting a wordlist. 19. Write a shell script which reads the contents in a text file and removes all the blank spaces in them and redirects the output to a file. 20. Write a shell script that changes the name of the files passed as arguments to lowercase. 21. Write a shell script to translate all the characters to lower case in a given text file. 22. Write a shell script to combine any three text files into a single file (append them in the order as they appear in the arguments) and display the word count. 23. Write a shell script that, given a file name as the argument will write the even numbered line to a file with name evenfile and odd numbered lines to a file called oddfile. 24. Write a shell script which deletes all the even numbered lines in a text file. 25. Write a script called hello which outputs the following: • your username • the time and date • who is logged on • also output a line of asterices (*********) after each section. 26. Write a script that will count the number of files in each of your subdirectories. 27. Write a shell script like a more command. It asks the user name, the name of the file on command prompt and displays only the 15 lines of the file at a time on the screen. Further, next 15 lines will be displayed only when the user presses the enter key / any other key. 28. Write a shell script that counts English language articles (a, an, the) in a given text file. 29. Write the shell script which will replace each occurrence of character c with the characters chr in a string s. It should also display the number of replacements. 30. Write a shell program to concatenate to two strings given as input and display the resultant string along with its string length. Write a shell program to simulate a simple calculator. 90) Write a shell program to count the following in a text file. • Number of vowels in a given text file. • Number of blank spaces. • Number of characters. • Number of symbols. • Number of lines 31. CPU scheduling algorithms • First Come First Serve • Shortest Job First • Priority • Round Robin 32. Semaphore and Deadlock • write a C program to implement the Producer & consumer Problem using Semaphore. • Write a C program to simulate Bankers algorithm for the purpose of deadlock avoidance. 33. Page Replacement Algorithms • First In First Out • Least Recently Used • Optimal • Least Frequently Used • Second Chance