Tuesday, 27 August 2013

Shell Script Assignment

Shell script Assignment 

How to write shell script that will add two nos, which are supplied as command line argument, and if this two nos are not given show error and its usage

Write Script to find out biggest number from given three nos. Nos are supplies as command line argument. Print error if sufficient arguments are not supplied.

Write script to print nos as 5,4,3,2,1 using while loop

Write Script, using case statement to perform basic math operation as
follows
+ addition
- subtraction
x multiplication
/ division
The name of script must be 'q4' which works as follows
$ ./q4 20 / 3, Also check for sufficient command line arguments

Write Script to see current date, time, username, and current directory

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

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.

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

Write script to print contains of file from given line number to next given number of lines. For e.g. If we called this script as Q13 and run as
$ Q13 5 5 myf , Here print contains of 'myf' file from line number 5 to next 5 line of that file.

Write script called say Hello, put this script into your startup file called .bash_profile, the script should run as soon as you logon to system, and it print any one of the following message in infobox using dialog utility, if installed in your system, If dialog utility is not installed then use echo statement to print message : -
Good Morning
Good Afternoon
Good Evening , according to system time.


Write shell script to show various system configuration like
 Currently logged user and his logname
 Your current shell
 Your home directory
 Your operating system type
 Your current path setting
 Your current working directory
 Show Currently logged number of users
 About your os and version ,release number , kernel version
 Show all available shells
 Show computer cpu information like processor type, speed etc
 Show memory information
 File system (Mounted)

Write a shell script to print the given number id palindrome?


Write a shell script to  check diskspace/mountpoint limit where limit is passed as argument.


Write a shell script to  check analyzed objects

Write a shell script to analyze schema

Write a shell script to check status of databases in a server

 

Linux Assignment

Linux Basic Assignments

Find you ipaddress and server name?

How will you find the bit of OS?

In ls -l  get the inode number.

Find the current users userid and groupid?

How will you find the absolute path of 'sqlplus'

In df -h, print only the used number.

How to find files that have been modified in the last 10 days and before 10 days

How to change permissions of a directory recursively

How to create a user and a group

How to change the password of a user

How to find the username and machine name

List files in a directory ordered by time or size

List first 10 lines in a file or last ten lines in a file

List lines 15 to 20 in a file with 50 lines

How will you find the total number of lines and words in a file

How will u create an empty file

How will append a  text to an existing file

How can you view the distinct lines in a file?

How can you view the duplicate lines in a file?

How can we transfer file from one server to another server?

Command used to backup a file in linux.

Command to find the file type.

How can we see the contents of tar file?

How can we diagnostics the network?

How can we find network information?

How do we get RAM information?

How  can we know number directories and files present in server?

how will you remount the filesystem and viceversa?

how can we get system information?
 
how will resolve booting issue?

how can you change the hostname and ipaddress?

how to find kernal version?

How to add mount point?

what is the use of sticky bit how do we configure?

How to display a particular column from a file?

How to execute ls command inside a vi editor?

How to change creation  time of existing file?

How will you delete last ten days records in OS level?