BASH
Bash programming
Description
The aim of the training is to prepare administrators on Linux systems to write, run and debug automated tasks that they may encounter on a daily basis in their professional tasks.
The aim of this practice-oriented course is to introduce participants to as many BASH scripting techniques as possible and to raise awareness of common errors that occur when writing them.
Outline
Introduction to the Bash shell:
- Shell Script Strengths and Weaknesses
- Overview of shells
- Switching between User Contexts
- Example shell script
- Environment variables
- Default environment variables
- Which and Type command
- General quotation mark rules
- Using command help (help, documentation)
- Whereis command
- Using Man pages
Shell scripting basics
- stdin, stdout, stderr
- alias
- Functions
- Colours in scripts
- Custom bash prompts
Working with files
- Communication channels
- File redirects
- Pipeline
- Mathematical operations (expr, let, (()))
Regular expressions
- Search within files
- Regular expressions overview
- RE character classes
- Regex quantifiers
- RE brackets
- Process editor (sed)
Grouping and loops
- Exit status
- body of command tests
- conditional states
- case description
- while and until loops
- for loop
- select
- functions
Data processing
- Text processing with AWK
- Text grouping
- Duplication removal utility
- Text column handling (cut -tuc)
- head - tail
Security, blank characters, and other practical advice
- Errors that can be made with quotation marks
- Linguistic possibilities for errors
- Maximum command length
- Empty characters in the "in for" loop
- Reading files with the while command
Prerequisites
To participate in the course, it is recommended to have Linux basics and advanced networking skills (LNX01-02-03) or at least 1 year of active daily Linux use in the last 1-2 years.