Tuesday, 4 June 2013

Anna university affiliated colleges reopening date for odd semester july 2013 to december 2013

Anna university Affiliated college reopening for odd semester July 2013 to December 2013 - Anna university affiliated colleges reopening date - Affiliated colleges reopening date for 1st 3rd 5th and 7th semester for July 2013 to Dec 2013.
Anna university officially announced the affiliated colleges reopening date,that is on 10.07.2013.This reopening is only for 3rd 5th and 7th semesters.The Anna university opening date for first semester students is on 01-08-2013.This news also officially announced by the anna university officials
Like Us on FaceBook to get Lates Anna University Updates:
--------------------------------------------------------------------------------------------------------------------------- ANNA UNIVERSITY AFFLIATED COLLEGES REOPENING DATE FOR ODD SEMESTERS - 2013

Anna university Reopening date for BE/B.TECH 3rd 5th and 7th Semester  - 10-07-2013
Anna university Reopening date for ME/M.TECH 3rd Semester                   - 15-07-2013
Anna university Opening date for BE/B.TECH 1st Semester                         - 01-08-2013 
---------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------
Anna University First Semester BE/B.TECH and ME/M.TECH Opening Date - 01-08-2013 

--------------------------------------------------------------------------------------------------------------------------- You can View the official Anna university announcement ---> Click Here
---------------------------------------------------------------------------------------------------------------------------
Like Us on FaceBook to get Lates Anna University Updates:

Related Tags:
  • Anna University Reopening date foe odd semesters - 2013
  • Anna University Affiliated colleges reopening date for 3rd semester 2013
  •  Anna University Affiliated colleges reopening date for 5th semester 2013 
  •  Anna University Affiliated colleges reopening date for 7th semester 2013 
  •  Anna University Affiliated colleges reopening date for 1st semester 2013 
Anna university Affiliated college reopening for odd semester July 2013 to December 2013 - Anna university affiliated colleges reopening date - Affiliated colleges reopening date for 1st 3rd 5th and 7th semester for July 2013 to Dec 2013.

Monday, 3 June 2013

Introduction to Shell Programming and Scripts

Introduction to Shell Programming

What is Shell Programming?

• putting UNIXTM commands in a file
• almost always special-purpose code
• often one-time code
• seldom used where speed is important
• often used to manipulate files

Basic shell scripts

Some of the familiar commands often useful in shell scripts are

cat - concatenate files
cp - copy a file
date -print the date and time
grep - scan for a string
head - show first lines of a file
tail - show last lines of a file
mv - move or rename a file
rm -f - remove files (silently)
wc - count lines, words, characters
        wc output format varies between systems

path names of files and directories
schedule relative
/home/37/jones/schedule absolute

wild cards in filenames
* matches zero or more characters
? matches exactly 1 character

redirection
> redirects std-out to a file
>> appends std-out to a file
< redirects std-in from a file

Pipelines of Commands

send std-out of one command to std-in of another
look e - shows spelling words that begin with e
look e | more - displays the words one page at a time
often use echo to feed a pipeline
echo "count me" | wc - prints 1 2 9
echo * | wc -w - counts files in current directory

About Shell Scripts

Type shell program text in a file using an editor:
#! /bin/sh
# this is a comment
body of program
to continue a line append \
this is the rest of the continued line
exit 0

chmod +x - scriptfile make the file executable
scriptfile - execute the program
sh -v scriptfile - print input lines as read
sh -x scriptfile - print commands as executed

shell programs often use temporary files in /tmp
and send unwanted outputs to /dev/null

Example Scripts

#!/bin/sh
# hi
echo "Hello, world!"
exit 0

unix[1] hi
Hello, world!
-----------------------------------
#!/bin/sh
# himike
name=Mike
echo "Hello, $name!"
exit 0

unix[2] himike
Hello, Mike!

-----------------------------------

Some more about Shell Programming

Exercises

some hints are given in the files
exer1, exer2, exer2.aix, and exer3.
1. Write a script that counts files. 
(a) First make it count the files in the current directory.
(b) Now modify your script to accept a parameter that is the name of a directory, and count
the files in that directory. Try this version on the current directory (.) and on the /afs/rpi.edu/campus/doc directory.
(c) Further modify your script so that if it is invoked without a parameter it prints out an explanation of how to use it.
2. If the ls command is given the name of a single extant file it merely prints that filename back out. 
(a) Write a script myls that behaves like ls except that when a single filename parameter is supplied it produces the output that ls -l would give for the file.
(b) Revise your script so that when a single filename parameter is given the output produced is the filename followed by the date and time of its most recent change and then the size of the file in bytes.
3. A script isyes is required that sets its exit code to 0 if its parameter is some variation of y or yes, and to 1 otherwise.
(a) Assume the only acceptable parameter values meaning “yes” are y, yes, Y, and YES, and solve the problem using only
shell programming features we have discussed.
(b) Simplify and generalize your script by using tr a-z A-Z, which reads from std-in, translates to upper case, and writes to std-out.
4. Write a script that adds up the sizes reported by ls for the files in the current directory. The script should print out only the total number of bytes used.


Sunday, 2 June 2013

C program to find the average of three numbers

Aim:

To write a c program to find the average of three numbers

Algorithm:

1.Start the program
2.Get three numbers from the users
3.Add three numbers and divide it by 3
4.Print the average value
5.Stop the program

C Program - Average of three numbers

#include<stdio.h>

#include<conio.h>
void main()
{
int n1,n2,n3;
float average;
clrscr();
printf("Enter the three numbers");
Scanf("%d %d %d",&n1,&n2,&n3);
average =(n1+n2+n3)/3.0;
printf("average of above three numbers is %.4f",average);
getch();
}

Output for  Average of three numbers C program

Enter three numbers
56
78
93
Average of above three numbers is 75.6667

Result
Thus the C program to find the average of three numbers is written and executed successfully.

C program to find sum of two numbers - Adding two numbers

Algorithm:

1.Start the program
2.Read two numbers from users
3.Add two numbers using addition operator
4.Print the sum value
5.Stop the program

C program - Sum of two numbers

#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,num3;
clrscr();
printf("Enter first number \n");
scanf("%d",&num1);
printf("Enter second number \n");
scanf("%d",&num2);
num3 = num1+num2;
printf("sum is %d \n",num3);
getch();
}

Output for  Sum of two numbers c program 

Enter first number
10
Enter second number
20
sum is
30

Result:

Thus the c program to add two numbers is written and executed successfully.