Monday, November 2, 2009

Assignment of Unix MCA-3

Unix Assignment II Date : 31/10/09

Submission Date : 5/11/2009

Q.1. Write Script to see current date, time, username, and current directory

Q.2. Write script to print given number in reverse order, for eg. If no is 123 it must print as 321.

Q.3.Write script to print given numbers sum of all digit, For eg. If no is 123 it's sum of all digit will be 1+2+3 = 6.

Q.4.How to perform real number (number with decimal point) calculation in Linux
Hint: Use bc command

Q.5.How to calculate 5.12 + 2.5 real number calculation at $ prompt in Shell?
Hint: Use command as, $ echo 5.12 + 2.5 | bc , here we are giving echo commands output to bc to calculate the 5.12 + 2.5

Q.6.How to perform real number calculation in shell script and store result to
third variable, lets say a=5.66, b=8.67, c=a+b?

Q.7.Write script to determine whether given file exist or not, file name is supplied as command line argument, also check for sufficient number of command line argument


Q8 -c -d -m -e
Where options work as
-c clear the screen
-d show list of files in current working directory
-m start mc (midnight commander shell) , if installed
-e { editor } start this { editor } if installed

Q.9. Write shell script to show various system configuration like
1) Currently logged user and his logname
2) Your current shell
3) Your home directory
4) Your operating system type
5) Your current path setting
6) Your current working directory
7) Show Currently logged number of users
8) About your os and version ,release number , kernel version
9) Show all available shells
10) Show mouse settings
11) Show computer cpu information like processor type, speed etc
12) Show memory information
13) Show hard disk information like size of hard-disk, cache memory, model etc
14) File system (Mounted)

Q.10.Write shell script to convert file names from UPPERCASE to lowercase file names or vice versa.

1 comment: