Bash Scripting for Beginners: Learn to Script Год выпуска: 2015 Производитель: Udemy Сайт производителя: udemy.com Автор: Andrei Bunghez Продолжительность: 1:55 Тип раздаваемого материала: Видеоклипы Язык: Английский Описание: This course is meant to help junior software or network engineers, or students to take the first steps into the world of bash shell scripting. It will help you develop your own scripts in order to interact efficiently with command line tools. The course is structured into two sections. The first section covers basic building blocks that allow you to write your own shell scripts. Here you will learn about basic utilities used throughout the course, a simple script structure, defining functions, using input/output redirection, pipes and command substitution. The last lectures in this section focus on control statements, like if, case, while and for. In the second section I will show you how to build a simple real-life utility for monitoring the amount of traffic on a network interface. There are two scripts involved in this utility. The "core", that queries system data about a network interface and adds it to a comma-separated-values (csv) file, one line at a time. The other one will take care of scheduling the "core" to be run at specific times, based on a user specified interval. The result is a csv file that contains data collected at specific points in time, data that can be later processed into a spreadsheet application (e.g. build graphs from it).
Содержание
1 Introduction Introductory lecture: find out how this course is structured and who is its intended audience. Section 1: Basic bash Building Blocks 2 Utilities Used in This Section This lecture briefly describes the utilities used throughout the course and shows you some basic uses. 3 Script Structure Going over the basic script structure, how to write comments, define and call functions. 4 Variables and the Environment This lecture shows you how to define and use variables. - Quiz 1 Variables and Expansion - 2 questions 5 Script and Function Parameters Arguments are the way a script receives data from the outside world. This lecture goes over how you can access parameter values and manipulate them. 6 Input/Output Redirection This lectures teaches you how to write output to a file, instead of the screen; and how to read input from a file, instead of the keyboard. 7 Pipes Pipes are a very powerful feature of the shell. This lecture shows you how to use them. 8 Command Substitution The fun part of using bash begins with command substitution. In this lecture you are going to learn how to replace a command name with its output. - Quiz 2 Recap - 4 questions 9 if This lecture covers the 'if' statement and the syntax of the associated condition. 10 case To avoid using multiple if/else if/else statements, use the 'case' statement, that matches an input expression to one of the given patterns. 11 while/until This lecture covers the while/until loops. 12 for Both forms of the 'for' loops, C-like and lists, are described in this lecture. Section 2: The ifMonitor Project - Monitoring a Network Interface 13 Project Goals - Text This document describes the ifMonitor project goals. 14 The check_iface Script: Extracting the Parameters This is the first lecture on the check_iface script, the "core" of the ifMonitor project. This first part shows you how to parse the command line parameters of the script. 15 The check_iface Script: Output Data In this second lecture on the check_iface script, one line of data is written to the output file. 16 cron & crontab cron & crontab are used to schedule tasks at a specified time. 17 The ifMonitor Script Using crontab to schedule the check_iface script.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum