Experiment No. 13 Presented by, Mr. Satish Pise. Write a shell script which checks disk space and store the value to the variable and display it. #!/bin/sh.

Slides:



Advertisements
Similar presentations
Shell Script Assignment 1.
Advertisements

Linux Jukebox Project Presented by: Andrew Dumitrascu Murray Saul.
More Shell Programming Software Tools. Slide 2 Keyword Shell Variables l The shell sets keyword shell variables. You can use (and change) them. HOME The.
V Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 13 Topics: Website Help Hyland Field Trip Review Coding Video.
1 Unix Talk #2 AWK overview Patterns and actions Records and fields Print vs. printf.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Shell Programming Software Tools. Slide 2 Shells l A shell can be used in one of two ways: n A command interpreter, used interactively n A programming.
CS 497C – Introduction to UNIX Lecture 33: - Shell Programming Chin-Chih Chang
Integer variables #!/bin/csh # sum of numbers from $argv[1] to $argv[2] set low = $argv[1] set high = $argv[2] set sum = 0 set current = $low while ( $current.
CIT 140: Introduction to ITSlide #1 CIT 140: Introduction to IT Advanced Shell Programming.
CS Lecture 04 Outline Change your shell Sed and awk Tricks with Bash scripts Assignment 1 discussion 1CS 311 Operating SystemsLecture 04.
Introduction to Unix – CS 21 Lecture 13. Lecture Overview Finding files and programs which whereis find xargs Putting it all together for some complex.
Introduction to UNIX GPS Processing and Analysis with GAMIT/GLOBK/TRACK T. Herring, R. King. M. Floyd – MIT UNAVCO, Boulder - July 8-12, 2013 Directory.
Submit Host Setup (user) Tc.data file Pool.config file Properties file Vdl-gen file Input file Exitcode checking script.
Using Unix Shell Scripts to Manage Large Data
Introduction to Linux and Shell Scripting Jacob Chan.
Shell Programming. Shell Scripts (1) u Basically, a shell script is a text file with Unix commands in it. u Shell scripts usually begin with a #! and.
Shell Control Structures CSE 2031 Fall August 2015.
Shell Programming, or Scripting Shirley Moore CPS 5401 Fall August 29,
1 Operating Systems Lecture 3 Shell Scripts. 2 Shell Programming 1.Shell scripts must be marked as executable: chmod a+x myScript 2. Use # to start a.
1 Operating Systems Lecture 3 Shell Scripts. 2 Brief review of unix1.txt n Glob Construct (metacharacters) and other special characters F ?, *, [] F Ex.
Chapter Nine Advanced Shell Scripting1 System Programming Advanced Shell Scripting.
Chapter 5 Bourne Shells Scripts By C. Shing ITEC Dept Radford University.
Linux Shell Programming Tutorial 3 ENGR 3950U / CSCI 3020U Operating Systems Instructor: Dr. Kamran Sartipi.
Writing C-shell scripts #!/bin/csh # Author: Ken Berman # Date: # Purpose: display command and parameters echo $0 echo $argv[*]
Keyword Shell Variables The shell sets keyword shell variables. You can use (and change) them. HOME The path to your home directory PATH Directories where.
#!/bin/sh echo Hello World cat Firstshellscript.sh Firstshellscript.sh.
Shell scripting. Number check vi isnump_n #!/bin/sh # # Script to see whether argument is positive or negative # if [ $# -eq 0 ] then echo "$0 : You must.
Agenda Regular Expressions (Appendix A in Text) –Definition / Purpose –Commands that Use Regular Expressions –Using Regular Expressions –Using the Replacement.
Shell Programming. Creating Shell Scripts: Some Basic Principles A script name is arbitrary. Choose names that make it easy to quickly identify file function.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
1 Operating Systems Lecture 2 UNIX and Shell Scripts.
Shell Programming Learning Objectives: 1. To understand the some basic utilities of UNIX File 2. To compare UNIX shell and popular shell 3. To learn the.
©Colin Jamison 2004 Shell scripting in Linux Colin Jamison.
CIT 140: Introduction to ITSlide #1 CIT 140: Introduction to IT Shell Programming.
Websites to check Professor Yee’s info transplantation/faculty/douglas-yee/index.htmhttp://
1 Lecture 9 Shell Programming – Command substitution Regular expressions and grep Use of exit, for loop and expr commands COP 3353 Introduction to UNIX.
CSCI 330 UNIX and Network Programming Unit IX: Shell Scripts.
1 Unix/Linux commands and shell programming-Part 2 (Dr. Mohamed El Bachir Menai)
Sed. Class Issues vSphere Issues – root only until lab 3.
Various 2. readonly readonly x=4 x=44 #this will give an error (like what in java?)
PHP Overview. What is PHP Widely available scripting language Free Alternative to Microsoft’s ASP Runs on the Web Server; not in the browser Example:
By Dr P.Padmanabham Professor (CSE)&Director Bharat Institute of Engineering &Technology Hyderabad Mobile
Part I: n Q1: n $ file * | grep “ascii text” | wc -l n Q2: n $ a.out | tee logfile n Q3: $touch file.`date +’%H%M%S’` n.
Debugging. Debug Syntax checking Shell tracing I-Enabling Debugging #!/bin/sh option.
Linux Essentials Chapter 12: Creating Scripts. Chapter 12 Outline Beginning a shell script Using commands Using arguments Using variables Using conditional.
Shell Control Structures CSE 2031 Fall June 2016.
1 Lecture 8 Shell Programming – Control Constructs COP 3353 Introduction to UNIX.
Computer Programming Batch & Shell Programming 9 th Lecture 김현철 컴퓨터공학부 서울대학교 2009 년 가을학기.
Introduction to the Linux Commandline
Shell Control Structures
Lecture 9 Shell Programming – Command substitution
NCAR-Developed Tools Bill Anderson and Marc Genty
Unix Scripting Session 4 March 27, 2008.
Shell Script Assignment 1.
Check Out for Initials Personalised Phone Case Satinjungle.com.
What is Bash Shell Scripting?
Presented by, Mr. Satish Pise
Unix Talk #2 grep/egrep/fgrep (maybe add more to this one….)
awk- An Advanced Filter
Presented by, Mr. Satish Pise
Shell Control Structures
Shell Control Structures
Chapter 5 Bourne Shells Scripts
Essential Shell Programming
Introduction to Bash Programming, part 3
Penetration Testing & Network Defense
Presented by, Mr. Satish Pise
Presented by, Mr. Satish Pise
Presented by, Mr. Satish Pise
Presentation transcript:

Experiment No. 13 Presented by, Mr. Satish Pise

Write a shell script which checks disk space and store the value to the variable and display it. #!/bin/sh #Retrive disk space info df=`df -Pl | grep "^/dev" | awk '{print $5, $6}' | sed "s/%//"` #Reference: df echo “$df”df

Shell Script to check connectivity of HOST PC #!/bin/sh # Ping a standard website with output suppressed, if ping completes then display success else failure echo "Checking PC connectivity..." ping -c 5 $1>>/dev/null if [ $? -eq 0 ] then echo "Able to reach PC!" else echo " Not able to check PC!" fi