Subscribe to Get Free Material Updates!
Visit my new blog WebData Scraping - Web Scraping Service provider company in India.

Write a script to implement the following commands Tree of DOS similar to which command of UNIX

echo "Enter path Name :=" read path name=`find "$path" -print0 | xargs -0` for i in $name do if [ -d $i ];then echo $i>file.txt count=`awk 'NF{print NF-1}' FS="/" file.txt` format="|__" temp=`expr $count + 1` i=`echo $i|cut -d "/" -f $temp` for (( j=0 ; $j < $count ; j=`expr $j + 1` )) do format="| "$format done echo "$format$i" fi done Output:  ...

Write a script to display the directory in the descending order of the size of each file.

clear echo "ENTER DIR" read dir `echo ls -lS $dir` > file.txt len=`cat file.txt | wc -l` i=2 echo "SIZE FILENAME" echo "==== ===============" while [ $i -le $len ] do record=`ls -lS $dir | head -n $i | tail -n 1` # record=`cat file.txt | head -n $i | tail -n 1` filename=`echo $record | cut -d " " -f 9` size=` echo $record | cut -d " " -f 5` echo "$size $filename" i=`expr $i + 1` done Output: ...

Write a script to display the date, time and a welcome message (like Good Morning etc.). The time should be displayed with “a.m.” or “p.m.” and not in 24 hours notation.

clear HH=`date +%H` time=`date +"%S %p"` if [ $HH -ge 12 ];then HH=`expr $HH % 12` if [ $HH -lt 5 ];then msg="GOOD AFTERNOON" elif [ $HH -ge 5 ] && [ $HH -lt 9 ];then msg="GOOD EVENING" else msg="GOOD NIGHT" fi echo "$msg ,CURRENT TIME $HH:$time" exit 1 else if [ $HH -lt 5 ];then msg="GOOD NIGHT" else msg="GOOD MORNING" fi echo "$msg ,CURRENT TIME $HH:$time" exit 1 fi Output:  ...

Write a script to display the name of all executable files in the given directory.

clear echo "Enter Directory Name:" read dir ls $dir>tempfile.txt count=0 if [ -d $dir ];then for filename in `cat tempfile.txt` do if [ -x $filename ];then echo "$filename" count=`expr $count + 1` fi done fi echo "Total Executable Files Are $count" rm tempfile.txt Output:  ...

Write a script to display the name of those files (in the given Directory) which are having multiple links.

clear echo "Enter Directory Name :=" read dir len=`ls -l $dir | wc -l` i=2 echo "File With Multiple Link are : " echo " " while [ $i -le $len ] do record=`ls -l $dir | head -n $i | tail -n 1` filename=`echo $record | cut -d " " -f 9` link=`echo $record | cut -d " " -f 2` if [ $link -gt 1 ];then echo "$filename = $link" fi i=`expr $i + 1` done Output:  ...

Write a script to delete zero sized files from a given directory (and all its sub-directories).

clear `echo ls`>filelist for filename in `cat filelist` do if [ ! -d $filename ];then size=`ls -s $filename` size=`echo $size|cut -d " " -f 1` if [ $size -eq 0 ];then echo "Want to Remove $filename:" rm -i $filename fi fi done Output: ...

Write a script to compare identically named files in two different directories and if they are same, copy one of them in a third directory

clear echo "Enter Directory 1:" read dir1 echo "Enter Directory 2:" read dir2 if [ ! -d $dir1 ] || [ ! -d $dir2 ]; then echo "dir1 not exist" exit 1 fi `echo ls $dir1`>dir1.txt `echo ls $dir2`>dir2.txt echo "===============" totalfile1=`wc -w dir1.txt|cut -c 8-9` # HOME totalfile2=`wc -w dir2.txt|cut -c 8-9` # HOME # totalfile1=`wc -w dir1.txt|cut -c 1-2` # COLLEGE # totalfile2=`wc -w dir2.txt|cut -c 1-2` # COLLEGE echo "totalfile:$totalfile1" echo "totalfile:$totalfile2" mkdir NEW_DIR i=$totalfile1 while [ $i -ge 1 ] do file1=`tail -n $i dir1.txt | head -n 1` i=`expr $i - 1` j=$totalfile2 while [ $j -ge 1 ] do file2=`tail -n $j dir2.txt | head -n 1` j=`expr $j - 1` if [ "$file1" == "$file2"...

write a script to copy the file system from two directories to a new directory in such a way that only the latest file is copied in case there are common files in both the directories

clear echo "Enter Directory 1:" read dir1 echo "Enter Directory 2:" read dir2 if [ ! -d $dir1 ] || [ ! -d $dir2 ]; then echo "dir1 not exist" exit 1 fi `echo ls $dir1`>dir1.txt `echo ls $dir2`>dir2.txt echo "===============" totalfile1=`wc -w dir1.txt|cut -c 8-9` # HOME totalfile2=`wc -w dir2.txt|cut -c 8-9` # HOME # totalfile1=`wc -w dir1.txt|cut -c 1-2` # COLLEGE # totalfile2=`wc -w dir2.txt|cut -c 1-2` # COLLEGE echo "totalfile:$totalfile1" echo "totalfile:$totalfile2" mkdir NEW_DIR # copying all files from dir1 and comparing each file with files in dir2 i=$totalfile1 flag=0 while [ $i -ge 1 ] do file1=`tail -n $i dir1.txt | head -n 1` i=`expr $i - 1` flag=0 j=$totalfile2 while [ $j -ge 1 ] do file2=`tail...

Write a script to broadcast a message to a specified user or a group of users logged on any terminal

echo "Enter user Name." read user_name echo "\tNOTE : Press Ctrl+d To Broadcast" write $user_name ...

Write a script to find the global complete path for any file

clear echo "Enter file name : " read filename str=`find . -name $filename` if [ "$str" == "" ];then echo "File not found" exit 1 fi path=`pwd` len=`echo $str | wc -c` str=`echo $str | cut -d "." -f 2-3` echo "Full path of file is $path$str" Output:  ...

Fetch the data from a file and display data into another file in reverse order

echo "Enter filename" read filename if [ ! -f $filename ];then echo "file not exist" exit 1 fi str=`cat $filename` len=`echo $str|wc -c` i=$len while [ $i -ge 1 ] do temp=$temp`echo $str|cut -c $i` i=`expr $i - 1` done echo $temp>newfile.txt cat newfile.txt Output:  ...

Accept filename and displays last modification time if file exists, otherwise display appropriate message

clear echo "Enter filename" read filename if [ -f $filename ];then echo "file exist and modification time is "; ls -l $filename | cut -c 50-54 else echo "file not exist" fi Output: ...

Shell script that accept strings and replace a string by another string

clear echo "Enter string" read str echo "Enter string to search" read sstr echo "Enter string to replace" read rstr str=`echo $str | sed s/$sstr/$rstr/` echo "string replaced successfully and string is $str" Output: ...

Accept number and check the number is even or odd finds the length of the number sum of the digits in the number

clear echo "Enter number:" read no; count=0 total=0 while [ $no -ne 0 ] do a=`expr $no % 10` no=`expr $no / 10` total=`expr $total + $a` count=`expr $count + 1` done if [ `expr $no % 2` -eq 0 ]; then echo "NUMBER IS EVEN" else echo "NUMBER IS ODD" fi echo "SUM OF ALL DIGITS:$total" echo "TOTAL NUMBER OF DIGIT:$count"  Output: ...

Accept the string and checks whether the string is palindrome or not

clear echo "Enter string \c" read str len=`echo $str|wc -c` len=`expr $len - 1` echo "length is "$len i=1 while [ $i -le $len ] do revstr=`echo $str|cut -c$i`$revstr i=`expr $i + 1` done if [ "$revstr" == "$str" ];then echo "string is palindrome" else echo "string is not palindrome" fi Output: ...

Accept numbers and perform addition subtraction division and multiplication

echo "Enter First Number := " echo "Enter First Number := " read a echo "Enter Second Number := " read b ans=`expr $a + $b` echo "Addition is :=" $ans ans=`expr $a - $b` echo "Subtraction is :=" $ans ans=`expr $a / $b` echo "Division is :=" $ans ans=`expr $a \* $b` echo "Multiplication is :=" $ans Output:   MCA Semester 3 Operating system Program...

GTU MCA Sem 3 Operating System and Unix Programs

 Subject Name: Programming Skills-V (OS) Subject Code: 630007 List of Practical Programs Related to Operating System and Unix Programs: Check the output of the following commands. date, ls, who, cal, ps, wc, cat, uname, pwd, mkdir, rmdir, cd, cp, rm, mv, diff, chmod, grep, sed, head, tail, cut, paste, sort, find. Write shell script Accept numbers and perform addition, subtraction, division and multiplication. Accept the string and checks whether the string is palindrome or not. Accept number and check the number is even or odd, finds the length of the number, sum of the digits in the number. Accept strings and replace a string by another string. Accept file name and displays last modification time if file exists, otherwise display appropriate message. Fetch the data from a file...

Gtu MCA Sem 3 SOOADM IMP Questions

Structured Object Oriented Analysis & Design Methodology (SOOADM) IMP Questions Unit 4. Object Modeling Concepts Explain modeling in details. Explain different models. What is object? Discuss OO Modeling. What is class? Explain attributes. Explain operations and methods. What is association? What is multiplicity? What is ordering? Explain generalization and overriding details. Explain aggregation. Differentiate Aggregation and Association. Differentiate Aggregation and Decomposition. What is abstract class? Explain multiple inheritance. What is metadata? What is reification? Explain constructions. What are packages? Explain events. Explain State. Draw and explain State diagram? Explain nested state diagram. What is nested states? Explain concurrency in details. ...

System Software IMP Questions

GTU MCA  SS (System Software) IMP Questions Chapter 1 From Dhamdhere's Book – Language Processors Q-1      What is System software or what do you mean by System Programming? How System Software differs from Application Software? Give examples of System Software? Q-2      Compare Program Translation model (e.g. compiler) with Program Interpretation Model (e.g. interpreter). Q-3      Explain the activities involved in Pass-I and Pass-II of Toy Compiler giving example. (Front End and Back End or Analysis and Synthesis) Q-4      Define following:- 1. Language Processor.            2 Grammar       3....

Android Practical Programs

Subject Name: Software Lab in Mobile Computing (SL-MC) Subject Code: 650017 Semester: Semester 5 Download GTU MCA Android Programs : Create “Hello World” application. That will display “Hello World” in the middle of the screen in the red color with white background. To understand Activity, Intent Create sample application with login module.(Check username and password) On successful login, go to next screen. And on failing login, alert user using Toast. Also pass username to next screen. Create login application where you will have to validate EmailID(UserName). Till the username and password is not validated , login button should remain disabled. Create and Login application as above . On successful login , open browser with any URL. Create an application that will pass some number...

Statistical Methods(SM) chapter 8 9 and 10 exercise solution

Statistical Methods(SM) Anderson's Chapter 8, 9 and 10 Exercise solution. Download Chapter 8 9 and 10 Solution  Related Posts: Chapter 3 Descriptive Statistics: Numerical Methods Chapter 4 Introduction to Probability Chapter 5 Discrete Probability Distributions Chapter 6 Continuous Probability Distributions Chapter 7 Sampling and Sampling Distributions Chapter 8 Interval Estimation Chapter 9, 10 ...

Java Program To Create New File

The below Java program creates new blank file named MyFirstFile.txt by passing  file name as argument to the constructor of File object. We must have to place file creation code in try block because it may throw IOException. We can check whether new file is created or not by using createNewFile() method of File object and place it in if...else condition. import java.io.*; class CreateFile { public static void main(String[] args) { try { /*Creates File MyFirstFile.txt in current Directory*/ File f1=new File("MyFirstFile.txt"); if(f1.createNewFile()) System.out.println("File Created Successfuly!"); else System.out.println("Fail to Create File!"); } catch(IOException e) { } } }...

Java File Handling Programs

Program Example Using FileInputStream and FileOutputStream Create a new file. Write single Byte to file using FileOutputStream. Read single Byte from file using FileInputStream Write an Array of Byte to file using FileOutputStream Read Sequence of Byte (Array of Byte) using FileInputStream Create CSV file and Read using FileInputStream and DataInputStream Program Example Using Reader and Writer  ...

GTU MCA Semester 3 Regular Question Papers

Question Papers of Statistical Methods...

Statistical Methods Exam Papers

Statistical Methods Question paper January 2011 ...

GTU MCA Semester 3 Exam Papers

GTU MCA Semester 3 Question Papers Download Semester 3 Regular Question Papers Download Semester 3 Remedial Question papers Question Papers of Structured & Object Oriented Analysis & Design Methodology (SOOADM) SOOADM Paper of May-July 2012 SOOADM Paper of Nov-Dec 2011 & Jan-Feb-2012 SOOADM Paper of May-June-July 2011 Question Papers of Fundamentals of Java Programming JAVA Paper of May-July 2012 JAVA Paper of Nov-Dec 2011 & Jan-Feb-2012 JAVA Paper of May-June-July 2011 Question Papers of Statistical Methods(SM)  SM Paper of May-July 2012 SM Paper of Nov-Dec 2011 & Jan-Feb-2012 SM Paper of May-June-July 2011 Question Papers of OpertingSystem(OS) OS Paper of May-July...

Job Placement is Now Done By GTU

2nd November, GTU (Gtjarat Technological University) announced that the job placement is done by GTU for all collages affiliated to GTU. Gujarat Technological University affiliated colleges of Engineering, MCA, MBA, ME, and Pharmacy colleges are located in various region of Gujarat. Students are very confused for college selection when they are going to take admission in one of the above course. Student pay donation to take admission in top ten colleges of Gujarat because all major companies going to arrange the Job Placement fair in these colleges. The students studying in colleges other than top ten colleges has ability to work in top companies stil they didn't get opportunity to participate in the job placement. Due to above reason powerful students can not get good job. After doing...

Programming Language Full Form

Recently I meet some of my friends at village who passed BCA, I asked some simple full forms of Programming Language. I really shocked when they replied that 'BASIC language has full form?'. So I decided to write a post on Programming Language Full forms. This post will helpful for all MCA, Msc.IT, BCA and Bsc. IT students. BASIC - Beginners All purpose Symbolic Instruction Code  COBOL - Common Business Oriented Language  FORTRAN - FORmula TRAN slating  ALGO - ALGOrithmic Language  HTML - Hyper Text Markup Language  XML - eXtensible Markup Language  PERL -  Practical Extraction Reporting Language  CSS - Cascading Style Sheet  PHP - Hypertext Pre processor  (Old name - Personal Home Page) ASP - Active Server Pages  AJAX - Asynchronous...

Page 1 of 4112345Next
Related Posts Plugin for WordPress, Blogger...

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes