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

Linux Assignment 4

The document outlines various shell script tasks including checks for positive, negative, or zero numbers, divisibility, even or odd status, leap year determination, and user input handling using switch-case for different scenarios. It also includes scripts for basic arithmetic operations, string palindrome checks, user and group management, and calculations involving natural numbers. Additionally, it covers reading multiple numbers to compute sums and averages, as well as displaying cubes of numbers up to a specified integer.

Uploaded by

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

Linux Assignment 4

The document outlines various shell script tasks including checks for positive, negative, or zero numbers, divisibility, even or odd status, leap year determination, and user input handling using switch-case for different scenarios. It also includes scripts for basic arithmetic operations, string palindrome checks, user and group management, and calculations involving natural numbers. Additionally, it covers reading multiple numbers to compute sums and averages, as well as displaying cubes of numbers up to a specified integer.

Uploaded by

dbda.iacsdakurdi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Write a Shell Script to check whether a number is negative, positive or zero.

Write a Shell Script to check whether a number is divisible by 5 and 11 or not.


Write a Shell Script to check whether a number is even or odd.
Write a Shell Script to check whether a year is leap year or not.
Shell Script to print number between 1 to 10 in character format using switch-case.
Shell Script to accept id from user to confirm department using switch-case.
Shell Script to check password is correct or incorrect using switch-case.
1Shell Script to print day of week using switch-case.
Shell Script to create calculator using switch-case.

Write a shell script to create a menu driven program for adding, deletion or finding a record in a
database. Database should have the field like rollno, name, semester and marks of three
subjects. Last option of the menu should be to exit the menu.

Write a Linux shell script to accept 10 number and tell how many are +tive, -tive and zero.

Write a shell script to accept five number and display max and min value.

Write a script to find out String is palindrome or not.

Write a shell script to print given number’s sum of all digits (eg. If number is 123, then it’s sum
of all digits will be 1+2+3=6)

Create a script to
Create user , Delete user , Create group , delete Group using case
Shell Script to compute the sum of the first 10 natural numbers.
Expected Output :
The first 10 natural number is :
1 2 3 4 5 6 7 8 9 10
The Sum is : 55
Shell Script to display n terms of natural numbers and their sum.
Test Data : 7
Expected Output :
The first 7 natural number is :
1234567
The Sum of Natural Number upto 7 terms : 28

Shell Script to read 10 numbers from the keyboard and find their sum and average.
Test Data :
Input the 10 numbers :
Number-1 :2
...
Number-10 :2
Expected Output :
The sum of 10 no is : 55
The Average is : 5.500000

Shell Script to display the cube of the number up to an integer.


Test Data :
Input number of terms : 5
Expected Output :
Number is : 1 and cube of the 1 is :1
Number is : 2 and cube of the 2 is :8
Number is : 3 and cube of the 3 is :27
Number is : 4 and cube of the 4 is :64
Number is : 5 and cube of the 5 is :125

You might also like