PG10: SHELL PROGRAMMING


วิทยากร : ผศ.ดร.วชิรศักดิ์ วานิชชา

ระยะเวลา : 4 วัน เวลา 08.30 – 16.30 น.

สถานที่ฝึกอบรม : อาคารคณะเทคโนโลยีสารสนเทศ มหาวิทยาลัยเทคโนโลยีพระจอมเกล้าธนบุรี

วัตถุประสงค์ :
      1. Manipulate text files with grep, sed, and nawk
      2. Use flow control constructs, such as branching and looping
      3. Customize system-wide shell initialization files
      4. Use local and environmental variables and shell metacharacters in scripts
      5. Use the exit status of a command to determine if the command succeeded or failed
      6. Develop interactive scripts
      7. Write a script that uses functions
      8. Write a script that uses a trap to catch a signal
      9. Access and process command-line arguments passed into a script
      10. Write sed scripts to perform noninteractive editing tasks
      11. Write nawk scripts to manipulate individual fields within a record
      12. Write nawk scripts to write reports based upon an input file
      13. Perform string manipulation and integer arithmetic on shell variables
      14. Write real world administration and reporting scripts
      15. Use regular expressions with the grep, sed, and nawk

ความรู้พื้นฐาน/คุณสมบัติผู้เข้าฝึกอบรม :
      1. Basic operating system
      2. มีความรู้ ความเข้าใจพื้นฐานระบบปฏิบัติการ Linux
      3. มีความรู้คำสั่งพื้นฐานของ UNIX
      4. มีความเข้าใจพื้นฐานด้านระบบเครือข่าย

วิธีการอบรม : บรรยาย สาธิต ฝึกปฏิบัติ ตอบข้อซักถาม

การประเมินผล : แบบทดสอบก่อนและหลังฝึกอบรม/แบบประเมินผลการฝึกอบรม

จำนวนผู้เข้าฝึกอบรม : ไม่เกิน 15 คน/กลุ่ม

หลักสูตรต่อเนื่อง/เกี่ยวข้อง :
      - UNIX (On Request)
      - LINUX (On Request)

รายละเอียดหลักสูตร :
      หลักสูตร Shell Programming เป็นหลักสูตรที่เหมาะสำหรับผู้ที่ต้องดูแลระบบเน้นให้มีทักษะในการอ่านเขียนและการแก้ปัญหา โดยสอนการใช้คำสั่งตั้งแต่พื้นฐาน โครงสร้างของระบบปฏิบัติการตั้งแต่ Basic จนถึงขั้น Advance การเขียนตรรกะเงื่อนไข การสร้างเมนูเพื่อการปฏิสัมพันธ์ของผู้ใช้ การเขียนเป็น Dialog menu การเขียน scrip เพื่อทำงานตามคำสั่ง การสร้างฟังก์ชั่น การเขียน loop ตามเงื่อนไข If then else เพื่อให้เกิดความเข้าใจสคริปต์ต่าง ๆ และเขียนสคริปต์ของตัวเองได้โดยอัตโนมัติตั้งแต่การ boot ระบบจนถึงการปิดระบบ


เนื้อหาการฝึกอบรม

วันที่ 1

-  Introduction to UNIX and LINUX

-  Basic knowledge about the UNIX

-       Turn on and off, Login and logout

-       Process, Kernel, Shell and File system

-  Basic command

-       How to change the password

-       Know how to use the online help facility

-       Know how to manipulate directories and files

-       Study Unix files permissions and how to change the permissions

-       Know how to use basic command

-       Know how to use standard file and redirection

-       Know how to use Unix text editor “vi”

-       Know how to use some Unix utilities to communicate with the other people in the system

-       Know how to backup and restore the file using “tar” command

-       Study the state of the executing processes and how to monitor or suspend the processes through the “ps” and “kill” command

-  Unix Shell and Shell Scripts

-       Describe the role of shells in the UNIX environment

-       Describe the standard shells

-       Define the components of a shell script

-       Write a simple shell script

 

 

-  Writing and Debugging Script

-       Start a script with #!

-       Put comments in a script

-       Change permissions on a script

-       Execute a script

-  Debug a script

วันที่ 2

-  Shell Basic and Shell Advance Features

-  Tools of the trade

-  Input and Output Redirection

-  Compound Command & Process Control

-  Shell Environment

-  Shell Programming

วันที่ 3

-  Regular Expressions and the grep Command

-       Use and describe regular expressions

-       Describe the grep command

-       Use the grep command to find patterns in a file

-       Use the regular expression characters with the grep command

-  The sed Editor

-       Use the sed editor to perform noninteractive editing tasks

-       Use regular expression characters with the sed command

-  The nawk Programming Language

-       Use gawk commands from the command line

-       Write simple gawk programs to generate data reports from text files

-       Write simple gawk programs to generate numeric and text reports from text files

-  Conditionals

-       Use the exit status of a command as conditional control

-       Use the "if" statement to test a condition

-       Pass values using command-line arguments (positional parameters) into a script

-       Create USAGE messages

-       Use conditional if, then, elif, else, and fi constructs

-       Use exit, let, and test statements ([[ ]], " ")

-       Apply the &&, ||, and ! Boolean logic operators

-       Use the case statement

 

 

-  Interactive Scripts

-       Use the print and echo commands to display text

-       Use the read command to interactively assign data to a shell variable

-       Read user input into one or more variables, using one read statement

-       Use special characters, with print and echo, to make the displayed text more user friendly

-       Create a "here" document

-       Use file descriptors to read from and write to multiple files

วันที่ 4

-  Loops

-       Write scripts that use for, while, and until loops

-       Write a script using the select statement

-       Describe when to use loops within a script

-       Generate argument lists using command, variable, and file-name substitution

-  Signals and Traps

-       Process script options using the getopts statement Advanced Variables, Parameters, and Argument Lists

-       Declare strings, integers, and array variables

-       Manipulate string variables

-       Change the values of the positional parameters using the set statement within a script

-       Use Korn shell arrays

-       Set default values for parameters

-       Use the Korn shell built-in let, print, set, and typeset statements

-  The getopt Statement

-  Advanced Variables, Parameters, and Argument Lists

-  Functions

-       Create user-defined functions in a shell script

-       Create, invoke, and display functions from the command line

-       Pass arguments into a function

-       Call functions from special (function) files that are saved in one or more function directories

-       Describe where functions are available for use