Posts

Showing posts from September, 2017

Unix Awk Script

Image
Awk Script  1. Print Even number of words in each line from file Ans. awk '{for(i=1;i<=NF;i++) if(i%2==0) printf("%s ",$i) else continue printf("\n") }' file1 O/P:-= is command file created awk {file1:- this is awk command example this file is created for awk } 2. Display words having length greater than 10 and consists of digit. Ans. awk '{for(i=1;i<=NF;i++) if(length($i)>10) if(int($i)) printf("%s ",$i) else continue printf("\n") }' file2 O/p: 12345678912 {file2: this is number file 123445 123456789 hcd kkd 72 7832 12345678912 1234156789 124 edne 124de edj 12dw ds5 asjkdeyfendj fdej kjd faiuendhgej dk fdkfj87fdnj77n dfjn jhfd hude7634bfdef }

Solved UNIX ASSIGNMENT-4 New

Image
UNIX ASSIGNMENT-4 Solved Tutorial - 4 Subject : Unix & Shell Programming 1.      write a shell script to copy one file into other, display appropriate message if destination file already exist. Script: echo "Enter source filename: " read sname echo "Enter destination filename: " read dname if [ -f $sname ] then         if [ -f $dname ]         then                 echo "Destination file already exists"                 echo "Do You want to overwrite the file?(y/n)"                 read ans                 if [ $ans = 'Y' -o $ans = 'y' ]                 then                         cp $sname $dname                         echo "Destination file overwritten"                 else                         echo "File not copied to Destination"                 fi         elif [ -d $dname ]         then                 echo "Destination type is directory"                 echo "Do you want to copy file

Unix Tutorial3 Ans

Unix Tutorial3 Solved 1. Write a command to display content of top three largest file in a working directory. cat `ls -lS | grep -v '^d' | head -n 4 | tail -n 3 | tr -s ' ' | cut -d ' ' -f 9` 2. Count no of words in lines 40 thrugh 60 of file f1.txt sed -n '4,8p' t1 | wc -w 3. Display all filenames not begining with "." find . -maxdepth 1 -type f ! -name '.*' -print 4.Delete all special characters from file f1. tr -cd '[a-zA-Z0-9 \n]' < t1 5.Display i-node no of all files of current directory. find . -maxdepth 1 -type f -ls 6.Display those lines of file f1 that contains exactly 50 characters in it. grep -E '^.{13}$' t1 7. Replace "hello" with "HELLO" in input file fin.sh and write those lines to output file fout.sh. tr 'hello' 'HELLO' < t1 > fout.sh 8.Extract all usernames and their home directories from /etc/passwd. cat /etc/passwd | cut -d ':' -f 1,6 9.Locate lines o

Asp.Net ASSIGNMENT

Image
ASP.NET ASSIGNMENT Asp.NET Final File Practical Assignment 1. .Asp.net web server control 2. Asp.net validation control 3. Asp.net html web server control 4. Drop down list application (country,state,city) 5. Master page 6. Themes 7. Repeater control with example 8. Site map path control with example 9. College management  

UNIX ASSIGNMENT-4

Image
UNIX ASSIGNMENT-4 Tutorial - 4 Subject : Unix & Shell Programming 1.     write a shell script to copy one file into other, display appropriate message if destination file already exist. 2.     write a shell script to find a file with maximum size in the current directory, also print the no. of words , characters, and lines along with the contents of file. 3.     write a shell script to display date, calender, current directory and list of files using case statement. 4.     write a shell script to change all .a extension file to .b in current directory. 5.     write a shell script to display currently logged in users and not log in users. 6.     write a shell script to display all files of directory without using ls. 7.     write a shell script to display message “good morning” or “good afternoon” or “good evening”, whenever you login. 8.     write a shell script to made a sum of 1 to 10 number. 9.     write a shell script to obtain sum of square of first n numbers. 10. write a she

Assignment CPPM 2

Image
Assignment – 2  Subject: CPPM Assignment – 2 Assignment Date: 05/9/2017 Subject: CPPM Submission Date: Questions: 1. Write a C program to find factorial value of any number. 2. Write a C program to generate multiplication table of any inputted number. 3. Write a C program to find all divisors of a inputted number. 4. Write a C program to add first seven terms of following series using for loop           5. Write a C program to print Fibonacci series.           1 1 2 3 5 8 ……. 6. Write a C program to print the following pattern           1           0 1           0 1 0           1 0 1 0           1 0 1 0 1 7. Write a program to calculate value of square, cube and factorial of all integers from 1 to 7. Print in following format Number Square Cube Factorial 1 1 1 1 2 4 8 2 3 9 27 6 8. Write a program to sort an integer array in descending order. 9. Write a program