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

UNIX Lab Assignment 5

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

UNIX Lab Assignment 5

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

UNIX and Networking BCA591

BCA 5th Semester

1. Write a shell script to find out whether a given number is Even or Odd.

2. Write a shell script to find out whether a given number is Prime or Not.

3. Write a shell script to produce the Sum of the following Series as well as to print the series:

a) 1+ 2+ 3+ . . . . . . . + n

b) 1+ 3+ 5+ . . . . . . . .+ n
4. Write a shell script to find out Reverse of a Given Number.

5. Write a shell script to find out Sum of the Digits of a Given Number.

6. Write a shell script to find out the Factorial of a Given Number.

7. Write a shell script to produce following output:


a) b)
* *
** * *
*** * * *
**** * * * *
***** * * * * *

8. Write a menu driven shell program which accepts values from 1 to 5 and performs actions depending
upon the number keyed in :

1) List of all files in Current Directory.


2) Processes of Users.
3) Today’s Date.
4) Users of the System
5) Quit from LINUX

9. Write a shell script to make a Simple Calculator (Using Switch Case).

10. Write a shell script that will lists the files whose names are started with Vowels in the current working
directory.

11. Write a shell script that accept a file name and find if a given file is an Ordinary File or a Directory File
otherwise it will give an error message that file not present. If the given file is an Ordinary file it
displays the content of that file.

12. Write a shell script that accept a File name and a Directory name from the user and then check both
the file and Directory exist in the current location. If they do then the file has to be copied to the
specified Directory, Otherwise it will give an error message that the File and/or Directory not present.

13. Write a shell script that accept two File names and will check if the given files are same or not. If the
Files are same then it will Remove the 2nd File otherwise it will display the content of both files.

14. Write a shell script that accepts a Username and will check if it is present or not from /etc/passwd file.
If the user present give the details like Full username, login name, home directory etc.

Soumen Pal, Technical Assistant, CSE Department, FIEM

You might also like