0% found this document useful (0 votes)
12 views

Assignment 2

nothing

Uploaded by

honeykanna2024
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Assignment 2

nothing

Uploaded by

honeykanna2024
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Write a shell script to print "Hello World".

Ans:

2. Write a shell script to add two numbers using as command-line arguments.

3. Write a shell script to check whether a number is even or odd.


4. Write a shell script to display multiplication table of given number.
5. Write a shell script to find the factorial of a given number.

6. Write a shell script to check whether a given character is vowel or consonant.


7. Write a shell script to find the largest of three numbers.
8. Write a shell script to check whether a given string is a palindrome.

9. Write a shell script to print the Fibonacci series up to n terms.


10. Write a shell script to reverse a string.
11. Write a shell script to reverse a number.

12. Write a shell script to check whether a file exists and is readable.
13. Write a shell script to count the number of lines, words, and characters in a file.

14. Write a shell script to calculate the sum of digits of a number.


15. Write a shell script to find all prime numbers between two numbers.
Write a shell script to find whether an input year is leap year or not.
Write a shell script to delete files older than 7 days from a specific directory.
18.Write a shell script to convert a string to uppercase.
19. Write a shell script to display all the files and directories in the current directory.
20. Write a shell script to find the sum of all even numbers from 1 to n.
21. Write a shell script to implement a basic calculator (addition, subtraction,
multiplication, division) using case statements.
22. Write a shell script to find the number of months between two dates.
23. Write a shellscript to Swapping Two Numbers Without Using a Third Variable.
24. Write a shell script to Solve a Linear Equation (ax + b = 0).
25. Write a shell script to concatenate two strings input by the user
26. Write a shell script to display all the files and directories in the current directory.
27. Write a shell script to read a file line by line and print each line with its line number.
28. Write a shell script to create a backup of a directory by copying it to another location.
29. Write a shell script to check the disk usage and send an alert if it exceeds a certain
threshold.
30. Write a shell script to perform linear search operation.

You might also like