19EAC211 OPERATING SYSTEM
Lab Sheet 4 Shell Programming NIKHIL S
AM.EN.U4EAC22045
1. Write a shell script to generate emails in the given format and write it into a file. Your script should
accept sender and recipient email id’s and subject as command line arguments. From:
[email protected]
To: [email protected] Cc: [email protected]
Subject: Subject 1
This email is generated by my shell script.
Thanks and regards
S4 CSE student
Amritapuri
2. Modify Question 1 to allow user to enter text at the beginning of email content, by passing it as a
command line argument.
3. Write a shell script to print all the primes below a given number.
19EAC211 OPERATING SYSTEM
4. Write a shell script to print the first n Fibonacci numbers.
4. Write a shell script to print the first n Fibonacci numbers.
5. Write a shell script to generate a multiplication table.
a. Interactive version: The program should accept an integer n given by the user and should print the
multiplication table of that n.
b. Command line arguments version: The program should take the value of n from the arguments
followed by the command.
c. Redirection version: The value of n must be taken from a file using input redirection
6. 6. Using function write a shell script to find gcd of two numbers
7. Using Recursion find factorial of a number
19EAC211 OPERATING SYSTEM
8. Write shell script to show various system configuration like:
a. Currently logged user and his long name
b. Current shell c. Home directory
d. Operating system type
e. Current path setting
f. Current working directory
g. All available shells