0% found this document useful (0 votes)
4 views1 page

Shell Programming Exercise

The document contains a list of exercises for writing Shell scripts, including calculating HRA and DA based on salary, finding the maximum of three numbers, calculating prime numbers, swapping two numbers without a third variable, printing a specific number structure using a while loop, summing the first N Fibonacci numbers using a for loop, and displaying the current working directory with permission changes for ordinary files.

Uploaded by

Pintu Jack
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
4 views1 page

Shell Programming Exercise

The document contains a list of exercises for writing Shell scripts, including calculating HRA and DA based on salary, finding the maximum of three numbers, calculating prime numbers, swapping two numbers without a third variable, printing a specific number structure using a while loop, summing the first N Fibonacci numbers using a for loop, and displaying the current working directory with permission changes for ordinary files.

Uploaded by

Pintu Jack
Copyright
© © All Rights Reserved
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/ 1

Exercise

1. Write a Shell code for calculating hra and da. # if basic is less than 1500, then HRA=10%
DA=90% if his salary is either equal to or above 1500 then HRA = 150 DA 1350

2. Write a Shell code for finding which is maximum of three numbers.

3. Write a Shell code for calculating prime numbers.

4. Write a shell script to swap two numbers without using 3rd variable.

5. Write a shell script using while loop to print the structure.

10

210

3210

43210

543210

6543210

76543210

876543210

9876543210

6. Write a shell script to find the sum of first “N‟ numbers in Fibonacci series (use for loop).

7. Using shell script, display the contents of the present working directory. If it is an ordinary
file print its permission and change the permissions to r--r--r--

You might also like