Отримати консультацію
Training Center MUKКурсыLINUX & UNIXLinux AdvancedПрограммирование средствами оболочек в UNIX/Linux

Shell Programming in UNIX / Linux

Код курсу
5 Днів, 40 Ак. Годин
Опис курсу
Програма курсу
Опис курсу


The course is designed to teach techniques that facilitate scripting for UNIX / LINUX OS versions, which are the most popular with customers.



The program includes fundamental knowledge about:

  • command shells and editors;
  • basic programming concepts in these operating environments.

Intended Audience

  • Advanced users
  • System and network administrators


  • General training in commercial or free distribution of UNIX or LINUX.
  • Programming experience is a plus.
Програма курсу


Module 1. History and flavours of command-line shells. POSIX standard for shells.

  • History of shells: Thomson’s sh, rc, Bourne, Korn, California (csh)
  • POSIX standard for shells.
  • Modern shells: Bourne Again (bash), zsh, tcsh, tclsh

Module 2. VI editor as a fundamental for UNIX shells operation.

  • History of editors: ed, em, ex, vi, sed, vim, emacs
  • Operation modes of VI editor, using command mode hot keys.
  • I Improved for GNU/Linux.

Module 3. Command line editing in shells.

  • What is a terminal? Terminal capabilities and behaviour: terminfo command
  • vi vs emacs mode, using control keys in different modes.
  • Readline in GNU/Linux

Module 4. Basic UNIX and GNU tools for command line operation

  • Working with documentation system, navigating and operating file system, searching files and content, hardware information, users information, working with processes.

Module 5. Shell Scripting fundamentals.

  • What is script?
  • Which shell should interprets script.
  • Script format.
  • Comments in scripts.
  • Portability issues.

Module 6. Variables

  • A concept of variables. Environment vs Local variables.
  • Variables substitution, conditional substitution.
  • Removing variables.
  • Shell built-in and special variables.

Module 7. User Input

  • Requesting user input: read command.
  • Positional parameters (command-line arguments).
  • Creating parameters. Shifting parameters.

Module 8. Designing program output

  • Basic output: echo vs print
  • Formatted output: printf
  • Advanced formatting in the terminal: tput

Module 9. Shell Arithmetic

  • Math in shell — integer operations.
  • Base10, Base2 and other radix.
  • Working with arithmetic. Operators.
  • Floating-point math using bc tool.

Module 10. Filename generation patterns

  • Mass operations on files.
  • Available patterns.
  • Filename globbing.

Module 11. Branches and Logic Testing

  • A concept of Return status
  • Logic testing: test command
  • Program flow branching constructs: if .. then .. elif .. else and case statements

Module 12. Program loops

  • The while and until conditional loops.
  • The for iteration loop.
  • The select loop.
  • Breaking a loop (continue, break, exit).

Module 13. The getopts Command

  • Parsing command-line options inside a script: getopts command.
  • Special shell variables OPTIND and OPTARG.
  • Enhanced option parsing: getopt. getopt vs getopts.

Module 14. Array Variables

  • Integer-indexed arrays.
  • Substituting and counting all elements.
  • Bash-style hash maps.

Module 15. Functions and Function Libraries

  • A concept of a shell function.
  • Displaying and declaring functions. Variable scope.
  • Function execution flow. return command.
  • Korn-style function libraries.

Module 16. Managing Input and Output

  • A concept of file descriptors. Data flow through a process.
  • Managing file descriptors. Special invocation of exec command.
  • Passing file contents to a script. Redirecting to a loop within script.
  • Using here-documents.

Module 17. Traps and Signals

  • A concept of signals. Common and well-known signals.
  • Handling a signal: trap command.
  • Controlling generation of signals from terminal: stty command.

Module 18. Regular Expressions

  • A concept of regular expressions.
  • Metacharacters and escaping. Different flavours of regular expressions syntax.
  • Applying regular expressions: grep command.
  • Perl-compatible regular expressions: pcretest command.

Module 19. Stream Editing with sed

  • Mass-processing a text streams: sed command.
  • A generic structure of a sed command.
  • Printing and deleting lines. Substituting patterns in the text. Reading and writing files.
  • Combining sed actions. Sed scripts.
  • GNU-specific advanced sed constructs.

Module 20. Introduction to AWK

  • Sophisticated text data processing: the awk command.
  • Structure of AWK program. Record processing. Pre and Post-input processing.
  • Pattern-matching and printing.
  • Complex pattern matching. Relational expressions.
  • AWK scripts.

Module 21. Variables, Strings, and Arithmetic Operations

  • User-defined variables. Reserved variables.
  • Accessing the environment and command-line arguments.
  • Arithmetic operations. String manipulation.
  • Formatting output.

Module 22. AWK Flow Control

  • Conditional operator: if
  • Loop constructs: for, while
  • getline, next and exit.
  • One- and multidimensional arrays. Associative arrays.
  • Processing arrays using special for loop.
  • Invoking external programs: system command.
Реєстрація на найближчий курс
Shell Programming in UNIX / Linux
Код курсу:
5 Днів, 40 Ак. Годин
Отримати консультацію
Свяжитесь со мной
Отримати консультацію
Отправить заявку
Реєстрація на вебінар
Отправить заявку
Ваша заявка отримана!
Ми зв`яжимося з вами найближчим часом.