Shell programming
Repetitive technical tasks can be organised into controlled processes. With Unix Shell, structure scripts and automation to make operations more repeatable. Build your autonomy while retaining the ability to understand and verify results.
- Duration
- 3 days 21 hours
- Code
- LX15FR Code
Presentation
This course provides the knowledge to use Bourne Shell (sh), Korn Shell (ksh) and Bourne Again Shell (bash) scripting languages.
Objectives
Participants learn to develop shell scripts for system operation and administration. The course begins with simple scripts that automate common commands, then introduces menus, functions, user interaction and conditional logic. By the end, participants will be able to understand initialisation scripts and create their own scripts to automate everyday tasks.
Program
Introduction
- The role of the shell.
- Features of different shells.
Command review
- File processing commands: tr, sort, uniq, head, tail and more.
- Command recall.
The vi command
- Using the command and practical tips.
Interactive shell use
- Wildcards.
- Escape characters.
- Overview of special characters.
- Redirection, including >>.
- Pipes.
Shell scripts
- Principles.
- Execution.
- Shebang.
- Shell options.
- Debugging.
- Script design best practices.
- Script structure.
Variables
- Variables: types, creation and advanced manipulation.
- Arrays: initialisation and advanced manipulation.
- Environment customisation files, including profile.
Interactivity
- The read command.
- Passing arguments: $0, $n, $#, $* and more.
Control statements
Aliases and functions
- Alias characteristics.
- Functions: syntax, return and FPATH.
Arithmetic
- expr, let and bc.
- ksh and bash specifics.
Regular expressions
- grep, fgrep and egrep commands.
- Implementing regular expressions.
Character strings
- expr and typeset commands.
- Practical tips.
- Wildcard expressions.
Introduction to sed and awk
Example of a system administration script
Audience
This course is designed for Unix or Linux users and system administrators seeking shell programming skills.
Prerequisites
Knowledge of basic Unix or Linux commands, or completion of the Linux Basics course (LX01FR), is recommended.
Teaching and assessment methods
- Initial skills assessment
- Training materials provided to participants
- Continuous assessment throughout the course
- End-of-course feedback questionnaire
- Combination of theory and practical application
- Attendance records
- Post-course follow-up evaluation
- Practical exercises
Dates and sessions
Choose the date and delivery format that suit you.
No upcoming sessions are currently available.
fr
en