Linux Shell Scripting
Request a Class
9:00am - 4:30pm
The GL375 is designed to provide the skills necessary to automate tasks on a Unix or Linux system. Systems Administrators and Developers alike can avoid errors, save time and money by replacing repetitive work patterns with shell scripts. Care has been taken to present the GL375 in a format that benefits all students, with or without previous programming experience. Guru Labs believes that the best way to learn shell scripting is writing shell scripts. For this reason, lab time is emphasized. Early labs present the scripting process step by step, while later labs are presented in a challenge format. While official solutions to each lab task are provided, students are encouraged to create their own before examining the solution. In this way, more experienced students are challenged without overwhelming the less experienced. Current Version: H01
AUDIENCE AND PREREQUISITES
Solid understanding of Unix-based systems and proficiency on the Unix or Linux command line.
Red Hat Enterprise Linux 7
SUSE Linux Enterprise 12
*Course Cost listed does not include the cost of courseware. Please refer to yourr Invoice for the additional cost. If you have any questions, please contact us (firstname.lastname@example.org or 207-775-0244). Course is subject to minimum enrollment. If minimum is not met this class may run as a LDL / Virtual class.
INTRODUCTION TO THE SHELL Shell Script Strengths and Weaknesses Shells, Switching User Contexts Example Shell Script Shell and Environment Variables Key Environment Variables Which and Type, General Quoting Rules Nesting Commands Help from Commands and Documentation whereis Getting Help Within the Graphical Desktop Getting Help with man & info LABSSHELL SCRIPTING BASICS Positional Parameters Input & Output printf alias Functions Colors in Scripts Custom Bash PromptsModule 3: Working with Files Communication Channels File Redirection Piping Commands Together Doing Math Filesystem Structures Determining Disk Usage With df and du cron The crontab Command crontab Format /etc/cron.*/ Directories Sending Email with mailxModule 4: Regular Expressions Searching Inside Files Regular Expression Overview Regular Expressions RE Character Classes Regex Quantifiers RE Parenthesis The Streaming EditorModule 5: Branching and Looping Exit Status Comparisons with test Conditional Statements Flow Control: case Flow Control: while and until Loops The for Loop Flow Control: select LabDATA MUNGING Text Processing with Awk Text Sorting Duplicate Removal Utility Extracting Columns of Text LABSSECURITY, WHITESPACE, AND OTHER GOTCHAS Gotcha: Quoting Variables Gotcha: Locales Gotchas: Maximum Command Length Gotcha: Whitespace in for Loops Reading Files with while Gotcha: $IFS Gotcha: Printing in .bashrc Gotcha: Aliases LABSA. CHALLENGE Apache Configuration Files httpd.conf VirtualHost Configuration LABSB. EMACS Emacs The Emacs Interface Basic Emacs More Emacs Commands LABS Text Editing with EmacsC. THE SECURE SHELL (SSH) ssh and sshd Configuration Accessing Remote Shells Transferring Files SSH Key Management