Linux Shell Scripting
Shellscripting mit Linux Shells
Unix basierte Systeme bieten durch die Shell ein mächtiges Instrument, um Systeme zu unterhalten, kontrollieren und überwachen. Über die Shell hat man direkten Einfluss auf das System und ist in der Lage, sämtliche Befehle auszuführen. Egal ob einfache, wiederkehrende Aufgaben oder komplexe Überwachung, alles kann bequem mit Shellscrpits gelöst werden.
Angehende System-Administratoren und Programmierer unter Linux.
Sie können bestehende Shell Scripts verstehen und eigene erstellen. Sie schreiben eigene Scripts mit regular expressions und automatisieren so Ihre Systemadministrationsaufgaben. Auch sed und awk sind nach diesem Kurs keine Fremdwörter mehr für Sie.
Grundkenntnisse von Linux, Commands und Tools. Bedienung des vi oder emacs Editors. Der Besuch des Kurses "Enterprise Linux Fundamentals" ist von Vorteil.
Inhalt
- SHELL SCRIPTING BASICS
- Shell Scripting
- Example Shell Script
- Shell/Environment Variables
- Key Environment Variables
- General Quoting Rules
- Nesting Commands
- Variables: Arrays
- Positional Parameters
- printf
- Input and Output
- alias
- Functions
- Colors in Scripts
Lab Tasks
- Shell Variables
- Shell Meta-Characters
- Command Substitution
- Aliases
- Bash Login Scripts
- Create "userinfo" and "sysinfo" functions
- WORKING WITH FILES
- Communication Channels
- File Redirection
- Piping Commands Together
- Doing Math
- Determining Disk Usage
- cron
- crontab Format
- /etc/cron.*/ Directories
- Sending Email with mail
Lab Tasks
- Disk and Filesystem Usage
- Connecting Commands
- DATA MUNGING
- Regular Expression Overview
- Regular Expressions
- RE Character Classes
- RE Quantifiers
- RE Parenthesis
- Searching Inside Files
- Replacing Text Characters
- The Streaming Editor
- Text Processing with awk
- Text Sorting
- Duplicate Removal Utility
- Extracting Columns of Text
Lab Tasks
- Pattern Matching with Regular Expressions
- Extended Regular Expressions
- Using Regular Expressions With sed
- Create "rmhost" function
- Create "showenv" function
- Parsing Mail Server Logs
- Fixing Incorrect Files
- BRANCHING AND LOOPING
- Exit Status
- Comparisons with test
- Conditional Statements
- Flow Control: case
- The for Loop
- Flow Control: while and until Loops
- Reading Files with while
- Flow Control: select
Lab Tasks
- Reporting User Statistics
- Monitoring Filesystem Usage
- SECURITY, WHITESPACE AND OTHER GOTCHAS
- Gotchas: Maximum Command Length
- Gotcha: Whitespace in for Loops
- Gotcha: $IFS
- Gotcha: Printing in .bashrc
- Gotcha: Aliases
Lab Tasks
- Renaming MP3 Files
- Split and Display $PATH
- A tar-based Backup
- WHERE TO FROM HERE?
- Waterfall Development
- Iterative Development
- Getting Help with man and info
- $MANPATH, whatis and apropos
- Help from Commands and Documentation
Lab Tasks
- Automated Virtual Host Provisioning

